Skip to content

SSO With Micronaut, this project was to test Micronaut with SSO and demonstrate some of the concepts of Micronaut.

Notifications You must be signed in to change notification settings

probsJustin/SSO-With-Micronaut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSO Example using Micronaut

About:

This project is for demonstrating the understanding of OAuth2.0, okta, and its use with in micronaut.

This is based on the following documentation: https://guides.micronaut.io/latest/micronaut-oauth2-okta-maven-java.html

Support:

I will not provide support for this repo.

Setup:

Steps:

  • Sign up at developer.okta.com and create a Web application with the following characteristics:

  • Add dependencies to maven:

    • Add Micronaut Security
    <dependency>
    <groupId>io.micronaut.security</groupId>
    <artifactId>micronaut-security-oauth2</artifactId>
    <scope>compile</scope>
    </dependency> 
    
    • Add Micronaut JWT Support:
    <dependency>
     <groupId>io.micronaut.security</groupId>
     <artifactId>micronaut-security-jwt</artifactId>
     <scope>compile</scope>
     </dependency>
    
  • Add the following OAuth2 Configuration: src/main/resources/application.yml

    security:
    authentication: idtoken 
    oauth2:
      clients:
        okta: 
          client-secret: '${OAUTH_CLIENT_SECRET:yyy}' 
          client-id: '${OAUTH_CLIENT_ID:xxx}' 
          openid:
            issuer: '${OIDC_ISSUER_DOMAIN:`https://dev-XXXXX.oktapreview.com`}/oauth2/${OIDC_ISSUER_AUTHSERVERID:default}' 
    endpoints:
      logout:
        get-allowed: true 
    
  • Set Environment Variables:

    export OAUTH_CLIENT_ID=XXXXXXXXXX
    export OAUTH_CLIENT_SECRET=YYYYYYYYYY
    export OIDC_ISSUER_DOMAIN=https://dev-XXXXX.oktapreview.com
    export OIDC_ISSUER_AUTHSERVERID=default
    
  • Run it

About

SSO With Micronaut, this project was to test Micronaut with SSO and demonstrate some of the concepts of Micronaut.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published