I am building an application using angular and spring boot. I need to use Azure AD for SSO from frontend then secure the spring boot services using the token. (In short my angular will connect with office 365 to login and then the user will authenticate connect with spring security, where it will verify the token, if valid it will give a response.) In angular, I am using adal-angular4 and in spring boot azure-active-directory-spring-boot-starter. Also, how to register the application(Frontend and backend) in Azure AD portal.
I am tried using some article. I get the response from the postman when I hit the URL using the token.
{
"code": 500,
"status": "failure",
"path": "/api/echo",
"message": "com.microsoft.aad.adal4j.AuthenticationException: {\"error_description\":\"AADSTS500131: Assertion audience does not match the Client app presenting the assertion. The audience in the assertion was '48eb1c7f-e02b-43a9-913a-XXXXXXXX' and the expected audience is 'a3edefea-1ff3-43ed-b2d7-=XXXXXXXXXXXXX' or one of the Application Uris of this application with App ID 'a3edefea-1ff3-43ed-b2d7-=XXXXXXXXXX'(PulseBE).\\r\\nTrace ID: 2aced69c-f12d-4b5d-97db-XXXXXXXXXX\\r\\nCorrelation ID: 226816c8-a2ed-488c-86ec-XXXXXXXXXXXXXXXX\\r\\nTimestamp: 2019-06-17 19:10:34Z\",\"error\":\"invalid_grant\",\"error_uri\":\"https:\\/\\/login.microsoftonline.com\\/error?code=500131\"}",
"timeStamp": "Tue Jun 18 00:40:35 IST 2019",
"trace": null
}