Spring Boot starter for graph-api-authentication library
Demo can be found here
- Add any Spring Boot starter dependency (provides
spring-boot
&spring-boot-autoconfigure
) - Add Microsoft Graph Java SDK dependency
- Specify following properties under
graph-api
:
- clientId - application (client) ID
- clientSecret - application secret
- tenant - directory (tenant) ID
- scopes - list of scopes. Optional.
https://graph.microsoft.com/.default
used by default - nationalCloud - national cloud using for authentication. Optional.
https://login.microsoftonline.com
used by default
Additionally for delegate permissions should be specified:
- user - userPrincipalName
- password - user password
- onlyDelegate -
true
, if application authentication bean is excess. Optional
- Autowire
IGraphServiceClient
bean, distinguished by name:
- applicationGraphClient - provides application permissions
- delegateGraphClient - provides delegate permissions