Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot and OAuth2 with Azure Active Directory

Japanese

Sample application of Spring Boot Security and Azure Active Directory.

Requirements

  • Azure subscription

Preparation

You configure authentication and directory access. Please refer to the following URL.

Create a line-of-business Azure app with Azure Active Directory authentication

When you register web application into AAD. You will get following informations.

  • Tenant id
  • Client id
  • Client key (Secred key)

You embed these id/key into application.yaml.

security:
  oauth2:
    client:
      clientId: <<your client id >>
      clientSecret: <<your client key>>
      accessTokenUri: https://login.microsoftonline.com/<<your tenant id>>/oauth2/token
      userAuthorizationUri: https://login.microsoftonline.com/<<your tenant id>/oauth2/authorize
      clientAuthenticationScheme: form
      scope: read
    resource:
      preferTokenInfo: false
      userInfoUri: https://graph.windows.net/me?api-version=1.6

...

aad:
  resource: https://graph.windows.net

Execution

You can execute the following commands.

$ bower install
$ mvn spring-boot:run
  • Open http://localhost:8080/
  • Click login button.
  • Redirect authentication page and logi it.
  • The login uers's information will be displayed.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages