Apache-2.0 license Download

authorisation

Mechanisms to determine if a user is authenticated and subsequently authorised to see a page

To utilise this library add this to your sbt build file

"com.cjww-dev.libs" % "authorisation_2.11" % "1.12.0" 

About

Actions.scala

Extend a class with Actions and utilise authorisedFor() to secure an action.

If the user is not authorised they will be directed to the specified URL provided in authorisedFor()

    class ExampleController @Inject()(val authConnector: AuthConnector) extends Controller with Actions {
      def exampleAction: Action[AnyContent] = authorisedFor("/login/page").async {
        implicit user =>
          implicit request =>
            Future.successful(Ok) 
      }
    }

License

This code is open source software licensed under the Apache 2.0 License