You mentioned that you are already using the azure-spring-boot-starter-active-directory. You need to make sure that you have added the azure.activedirectory.redirect-uri-template
property in the format required for your version 5.6 and that the BASE_URI is updated to the URI that you have set in the application registration (https://yourapp.com)
application.yml
:
spring:
cloud:
azure:
active-directory:
redirect-uri-template: ${REDIRECT-URI-TEMPLATE}
spring:
cloud:
azure:
active-directory:
b2c:
authenticate-additional-parameters:
domain_hint: xxxxxxxxx # optional
login_hint: xxxxxxxxx # optional
prompt: [login,none,consent] # optional
base-uri: ${BASE_URI}
credential:
client-id: ${WEBAPP_AZURE_CLIENT_ID}
client-secret: ${WEBAPP_AZURE_CLIENT_SECRET}
login-flow: ${LOGIN_USER_FLOW_KEY} # default to sign-up-or-sign-in, will look up the user-flows map with provided key.
logout-success-url: ${LOGOUT_SUCCESS_URL}
user-flows:
${YOUR_USER_FLOW_KEY}: ${USER_FLOW_NAME}
user-name-attribute-name: ${USER_NAME_ATTRIBUTE_NAME}
You need to follow all of the steps for customizing the redirect-uri , make sure that all references to that URL match, and then make sure that there aren't any differences (extra slash or space, etc).
You can double-check all of the dependencies on this page to make sure you aren't missing anything. https://microsoft.github.io/spring-cloud-azure/current/reference/html/index.html#configure-redirect-uri-template
Otherwise if you are using your own web server like spring boot, you typically need to add custom logic or let the app service do the authentication by using the App Service EasyAuth feature. https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization
See related discussion:
Let me know if this helps and if you still run into this issue.
If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar questions.