I am trying to implement Oauth Code Grant flow using Azure AD as the authorization server. Followed these steps to implement the Code grant flow.
- Created Azure AD app with the redirect_uri where I like to get the auth token.
2.App permissions as below
- Configured the client id and secret at the client application side and the complete flow is working. I am able to receive the auth token and access token.
There are few things I would like to get clarified with Azure AD authentication.
In some materials and blogs, I am seeing 2 Azure apps are registered in the Azure AD. One for Resource API(i.e, backend API) and the other Azure app for the Consumer application which requests access to this API. When should we go for registering 2 apps in Azure ad.
Is it when Scope are defined for the backend api, we need to register an Azure AD app for backend resource with the scopes listed?
Or registering Azure app is tied to OAuth Grant types? i.e, Client credentials - 2 apps and for OAuth Code Grant - 1 app will do.
These may be basic questions, but am not finding these questions clarified if any documents.
Any help on this is much appreciated.