Giter VIP home page Giter VIP logo

grails-shiro's Introduction

This is the OLD plugin Repo

Don't post issues here please.

New Grails Shiro plugin

The Grails 3 (Grails 3 & 4, Shiro 1.5+) plugin has been re-written and now lives at https://github.com/nerdErg/grails-shiro . The code here should be considered archived and not for current use (it contains some vulnerabilities and is not maintained)

You can find the plugin on the plugin portal at http://plugins.grails.org/plugin/nerderg/grails-shiro

OLD Grails 3 Shiro plugin

Build Status

Documentation is a work in progress.

Installation

To install this plugin you need to add this to your build.gradle dependencies.

compile 'org.grails.plugins:grails-shiro:3.3.0'

Configuration

To override default configuration of the shiro plugin you can simply add corresponding configuration keys to your application.groovy or application.yaml file.

grails {
  plugin {
    shirosecurity {
      session.mode = [null, 'native'] //default null
      filter {
        loginUrl = [url for your login page] //default "/auth/login"
        unauthorizedUrl = [url for your unauthorized page] //default "/auth/unauthorized"
        successUrl = [url for your success page] //default null
        basicAppName = [name to show in basic http auth] //not configured by default, it triggers basic auth
        filterChainDefinitions = optional, see [https://shiro.apache.org/static/1.4.0/apidocs/org/apache/shiro/spring/web/ShiroFilterFactoryBean.html#setFilterChainDefinitions-java.lang.String-]
      }
      authc.required = [boolean] //Get the config option that determines whether authentication is required for access control or not. By default, it is required.
      redirect.uri = [url for redirect when page needs authentication] //default "/auth/login?targetUri={urlRequested}"
    }
  }
}

Available codegen scripts

To help you get started, plugin provides convenient way to generate required classes. You can use them with your grails command or grails wrapper grailsw.

grails shiro-quick-start [--prefix your.package.name.ClassPrefix] - creates basic domain classes, database realm to authenticate your users against database and security interceptor and auth controller. Default prefix is shiro3.Shiro.

grails create-wildcard-realm [--prefix your.package.name.ClassPrefix] - creates a new database realm from a template that only works with wildcard permissions. Other types of permission are not supported.

grails create-security-interceptor [--prefix your.package.name.ClassPrefix] - creates a new security interceptor from a template.

grails create-ldap-realm [--prefix your.package.name.ClassPrefix] - creates a new ldap realm from a template.

grails create-db-realm [--prefix your.package.name.ClassPrefix] - creates a new database realm from a template that only works with database permissions. Other types of permission are not supported.

grails create-auth-controller [--prefix your.package.name.ClassPrefix] - creates a new authentication controller from a template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.