Hello @Keith Viking !
Here are the high-level steps to achieve this:
Register your Web API application in Azure AD using the Azure portal.
Configure your Web API application to accept JWT access tokens issued by Azure AD.
In your Web API application, add the [Authorize]
attribute to the controller or action methods that require authentication.
Configure the authentication middleware in your Web API application to use Azure AD as the authentication provider.
Configure the authorization middleware in your Web API application to validate the user's claims and roles.
- Create and assign Azure AD application roles to control access to your Web API endpoints. * this is already described from my earlier response *
Create and manage user and service principal accounts in Azure AD, and assign them to the appropriate Azure AD application roles.
Once you have implemented Azure AD authentication and authorization in your Web API, you can use the Azure AD authentication libraries to obtain an access token for your Web API using a client application or script. This access token can be used to call your Web API endpoints and retrieve or modify data.
For more information on implementing Azure AD authentication and authorization for a Web API, see the following resources:
Please read carefullu and take your time to understand !
ALSO
Here is a SAMPLE Manifest ( It is only a sample based on my uderstanding !!)
{
"appId": "<APP_ID>",
"appRoles": [
{
"allowedMemberTypes": [
"User"
],
"description": "Can read data",
"displayName": "Read",
"id": "9e34523e-f6dd-4821-8788-39af5d6cf579",
"isEnabled": true,
"value": "Data.Read"
},
{
"allowedMemberTypes": [
"User"
],
"description": "Can write data",
"displayName": "Write",
"id": "b0be2916-3a04-4f3e-8cf8-1de59459f1e2",
"isEnabled": true,
"value": "Data.Write"
}
],
"availableToOtherTenants": false,
"displayName": "My App",
"groupMembershipClaims": null,
"identifierUris": [
"https://myapp.com"
],
"oauth2AllowImplicitFlow": false,
"optionalClaims": null,
"orgRestrictions": [],
"parentalControlSettings": {
"countriesBlockedForMinors": [],
"legalAgeGroupRule": "Allow"
},
"passwordCredentials": [
{
"customKeyIdentifier": null,
"endDate": "2022-05-31T16:38:41.8606916Z",
"keyId": "<KEY_ID>",
"startDate": "2021-05-31T16:38:41.8606916Z",
"value": "<KEY_VALUE>"
}
],
"publicClient": null,
"replyUrls": [
"https://myapp.com/signin-oidc"
],
"requiredResourceAccess": [
{
"resourceAppId": "<RESOURCE_APP_ID>",
"resourceAccess": [
{
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
"type": "Scope"
}
]
}
],
"samlMetadataUrl": null,
"signInAudience": "AzureADMultipleOrgs",
"spa": {
"redirectUris": [
"https://myapp.com/redirect"
]
},
"tags": null,
"tokenEncryptionKeyId": null
}
The answer or portions of it may have been assisted by AI Source: ChatGPT Subscription
Kindly mark the answer as Accepted and Upvote in case it helped or post your feedback to help !
Regards