Create AAD Applications
Create AAD Application for UI
Create an AAD Application for the UI:
Go to the new Azure portal - App registrations pane.
Click + New Registration
If prompted choose Register in this Directory
Enter a "ShareThrift" for your application.
Under Supported account types, select Accounts in any organizational directory and personal Microsoft accounts.
Redirect URI
Choose Single-page application (SPA) from the option list
For the URI add the public URL from your CDN Endpoint, e.g https://sharethrift.azureedge.net)
Select Register.
Configure AAD Application for the UI
In the AAD Application just created, navigate to Manage > Authentication in the navigation menu on the left.
In Platform Configurations, look for the Single Page Application
in the section, Redirect URIs
Click Add URI and add: http://localhost:5000/
Logout URL add:
(add the public URL from your CDN Endpoint, e.g https://sharethrift.azureedge.net) + /logged-out
Implicit Grant (leave checkboxes unchecked)
Live SDK Support: Yes
Default Client Type: No
Choose Save at the top of the screen.
Copy the Application (client id) from the Overview panel of this Application to a text document, well use it shortly
Create AAD Application for the API
Create an AAD Application for the API:
Go to the new Azure portal - App registrations pane.
Click + New Registration
If prompted choose Register in this Directory
Enter a "ShareThrift" for your application.
Under Supported account types, select Accounts in any organizational directory and personal Microsoft accounts.
Redirect URI (leave blank)
Select Register.
Expose an AAD Api / Add Client Application
Under Manage > Select Expose An Api
Application ID URI : Select Set and
choose a value like api://sharethrift<randomnumber>.com
click Save
Scopes defined by this API : click + Add a scope, the add a scope pane showed.
Scope Name: access_as_user
Who can consent: Admins and users
Admin consent display name: Access ShareThrift API
Admin consent description: Allows the app to access the ShareThrift API as the signed-in user.
User consent display name: Access ShareThrift API
User consent description: Allow the application to access the ShareThrift API on your behalf.
State: Enabled
Click Add Scope (the pane will disappear)
Authorized Client Applications
Click Add a client application
Paste in the Application (client id) value from the AAD Application for the UI
Check the the api://sharethrift<randomnumber>.com/access_as_user scope you just created.
Click Save
Create Custom Roles for UI and API
Repeat the following for BOTH the UI and the API Applications, be sure to change the ID to a new GUID for each value each time.
Under Manage > Select Manifest
Locate the area of the document with
"appRoles": [],
And replace it with:
(Be sure to update the <<CHANGE TO NEW GUID>> with new, unique GUID values)
Add a user to the roles
Add A user to the role for both applications
Navigate to Active Directory in the Azure Portal
Under Manage > Select Enterprise Applications
Select ShareThrift from the list of applications
Under Manage > Select Users and groups
Choose Add Users
For users - select yourself
Select Role: select Moderator
Click Assign
Resources:
Microsoft
DON"T USE IMPLICIT GRANT - Read Why
Last updated