Skip to content

Instantly share code, notes, and snippets.

@cjvandyk
Created April 19, 2023 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjvandyk/49c9e5b467d2e9e38bb4f3bd14f71a26 to your computer and use it in GitHub Desktop.
Save cjvandyk/49c9e5b467d2e9e38bb4f3bd14f71a26 to your computer and use it in GitHub Desktop.
MSAL in C#
string[] scopes = { "user.read" };
string clientId = "your-client-id";
string redirectUri = "http://localhost/myapp";
IPublicClientApplication app = PublicClientApplicationBuilder
.Create(clientId)
.WithRedirectUri(redirectUri)
.Build();
AuthenticationResult result = await app.AcquireTokenInteractive(scopes)
.ExecuteAsync();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment