Skip to content

A Grails plugin that provides a provider service for Spring Security OAuth2 using Okta

Notifications You must be signed in to change notification settings

moksamedia/okta-oauth2-service

Repository files navigation

Okta Provider Plugin for Grails Spring Security OAuth2 Plugin

Defines an Okta OAuth2 provider for using with Grails Spring Security.

Requires

    compile 'org.grails.plugins:spring-security-core:3.2.1+'
    compile 'org.grails.plugins:spring-security-oauth2:1.1.0+'

Installation

TODO: link to tutorial or write out simple steps here

Configuration

application.groovy

If you want to override the default login form and always redirect to login with Okta, add the following to the application.groovy file:

grails.plugin.springsecurity.auth.loginFormUrl = '/springSecurityOAuth2/authenticate?provider=okta'
Application.yml

You must configure your API key and secret from Okta as well as the following 3 URLS:

  • /userinfo
  • /authorize
  • /token

The OAuth2 callback defaults to /oauth2/callback

    plugin:
        springsecurity:
            oauth2:
                active: true
                registration:
                    roleNames: ['ROLE_USER'] # this is the role assigned to new users registered through OAuth
                    okta:
                        api_key: '<your key>'         
                        api_secret: '<your secret>'
                        userInfoUrl: 'https://<your Okta URL>.com/oauth2/v1/userinfo'
                        authorizeUrl: 'https://<your Okta URL>.com/oauth2/v1/authorize'
                        tokenUrl: 'https://<your Okta URL>.com/oauth2/v1/token'    
                        scopes: 'email profile openid'
                 

About

A Grails plugin that provides a provider service for Spring Security OAuth2 using Okta

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published