Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

initial sample #2

Merged
merged 21 commits into from
May 22, 2020
Merged

initial sample #2

merged 21 commits into from
May 22, 2020

Conversation

derisen
Copy link
Contributor

@derisen derisen commented May 3, 2020

Overview

This sample demonstrates a React & Redux single-page application allowing a user to authenticate and authorize an ASP.NET Core Web API that was protected by Azure AD to call MS Graph API on its behalf using the AAD on-behalf-of flow.

The API call to MS Graph API is made using the MS Graph SDK.

Scenario

  • The sample implements an onboarding scenario where a profile is created for a new user upon first login. The profile fields are pre-populated by the available information about the user on MS Graph API.
  • ProfileSPA uses MSAL.js to authenticate a user and React-Redux to store id and access tokens.
  • Once the user authenticates, ProfileSPA obtains an access token from Azure Active Directory (Azure AD).
  • The access token is then used to authorize the ProfileAPI to call MS Graph API on user's behalf. In order to call MS Graph API, ProfileAPI uses the MS Graph SDK.
  • To protect its endpoint and accept only the authorized calls, the ProfileAPI uses MSAL.NET and Microsoft.Identity.Web.

Some screenshots:

login
consent
onboard
view

@franva
Copy link

franva commented May 3, 2020

This is what I am looking for, thanks a lot. I will give it a try.

Copy link

@TiagoBrenck TiagoBrenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an observation in the app scripts, on the SPA project, authConfig.js is receiving the app id of the API instead of the SPA. Other than this, LGTM

},
{
"Comment": "Navigate to the Manifest page, find the entry for 'KnownClientApplications' and add the clientId of ProfileSPA."
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed. The generated code in configure.ps1 does this as well

Copy link
Contributor

@kalyankrishna1 kalyankrishna1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@derisen derisen merged commit 1eafbcb into master May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants