-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graph doc updates post bug bash #533
Merged
michael-hawker
merged 18 commits into
MicrosoftDocs:master
from
shweaver-MSFT:shweaver/graph-updates
Jun 15, 2021
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f4b8e3b
Hiding preview Graph docs in toc
shweaver-MSFT ea7ae0b
Graph doc updates
shweaver-MSFT 1b815dd
Updates to providers overview
shweaver-MSFT 6efe6c4
Adjusted file names and link paths
shweaver-MSFT 5eeda86
Added constructor details to Msal/Windows providers.
shweaver-MSFT 9fa0ac1
Updated graph controls documentation
shweaver-MSFT 74b0ec5
Small tweaks
shweaver-MSFT 2c02c00
Fixed link typo
shweaver-MSFT 9ce34f9
Lint fixes
shweaver-MSFT 75bfd51
updated getting started headers
shweaver-MSFT 49514c8
Added redirect configuration
shweaver-MSFT 7cb390a
Updated toc
shweaver-MSFT 80d0e2b
Updated redirection json
shweaver-MSFT fbd8eb6
Update docs/graph/authentication/overview.md
shweaver-MSFT a326bf7
Updated graph docs with new ProviderManager events
shweaver-MSFT e3f4b9b
Merge branch 'shweaver/graph-updates' of https://github.com/shweaver-…
shweaver-MSFT d319916
Lint fix
shweaver-MSFT 12ff279
Update docs/graph/authentication/msal.md with missing link
michael-hawker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"redirections": [ | ||
{ | ||
"source_path": "archive/graph/providers/InteractiveProviderBehavior.md", | ||
"redirect_url": "/graph/providers/interactiveproviderbehavior", | ||
"redirect_document_id": true | ||
}, | ||
{ | ||
"source_path": "archive/graph/providers/MockProviderBehavior.md", | ||
"redirect_url": "/graph/providers/mockproviderbehavior", | ||
"redirect_document_id": true | ||
}, | ||
{ | ||
"source_path": "graph/authentication/msal.md", | ||
"redirect_url": "/graph/authentication/msalprovider", | ||
"redirect_document_id": true | ||
}, | ||
{ | ||
"source_path": "graph/authentication/windows.md", | ||
"redirect_url": "/graph/authentication/windowsprovider", | ||
"redirect_document_id": true | ||
}, | ||
{ | ||
"source_path": "graph/authentication/custom.md", | ||
"redirect_url": "/graph/authentication/iprovider", | ||
"redirect_document_id": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: MsalProvider | ||
author: shweaver-MSFT | ||
description: Authentication provider based on the official Microsoft Authentication Library (MSAL). | ||
keywords: uwp, wpf, netstandard, windows, community, toolkit, graph, login, authentication, provider, providers, identity, msal | ||
dev_langs: | ||
- csharp | ||
--- | ||
|
||
# MsalProvider | ||
|
||
The MsalProvider is an [IProvider](./custom.md) implementation built on the official Microsoft Authentication Library (MSAL). It is NetStandard 2.0 so it works in both UWP and WPF apps. | ||
|
||
> Available in the `CommunityToolkit.Authentication.Msal` package. | ||
|
||
> [!IMPORTANT] | ||
> Windows Community Toolkit - Graph Controls and Helpers packages are in preview. To get started using WCT preview packages visit the [WCT Preview Packages wiki page](https://aka.ms/wct/wiki/previewpackages). | ||
|
||
```csharp | ||
using CommunityToolkit.Authentication; | ||
|
||
string clientId = "YOUR-CLIENT-ID-HERE"; | ||
string[] scopes = new string[] { "User.Read" }; | ||
|
||
ProviderManager.Instance.GlobalProvider = new MsalProvider(clientId, scopes); | ||
``` | ||
|
||
## Prerequisite Configure Client Id in Partner Center | ||
|
||
> [!IMPORTANT] | ||
> To obtain a Client Id, first register your app in Azure following the guidance here: [Quickstart: Register an application with the Microsoft identity platform](/azure/active-directory/develop/quickstart-register-app) | ||
> | ||
> After finishing the initial registration, you will also need to add an additional redirect URI. Click on "Authentication -> Add a Platform", select "Mobile and desktop applications", and check the "https://login.microsoftonline.com/common/oauth2/nativeclient" checkbox on that page. Then click "Configure". | ||
|
||
## Constructor | ||
|
||
| Parameter | Type | Default | Description | | ||
| -- | -- | -- | -- | | ||
| clientId | string | | Registered client id. | | ||
| scopes | string[] | null | Listof scopes to initially request. | | ||
| redirectUri | string | `https://login.microsoftonline.com/common/oauth2/nativeclient` | Redirect URI for authentication response. | | ||
| autoSignIn | bool | true | Determines whether the provider attempts to silently log in upon instantiation. | | ||
|
||
## Properties | ||
|
||
| Property | Type | Description | | ||
| -- | -- | -- | | ||
| State | ProviderState | Gets the current authentication state of the provider. | | ||
|
||
## Events | ||
|
||
| Event | Type | Description | | ||
| -- | -- | -- | | ||
| StateChanged | EventHandler<ProviderStateChangedEventArgs> | Event called when the provider state changes. | | ||
|
||
## Methods | ||
|
||
| Method | Arguments | Returns | Description | | ||
| -- | -- | -- | -- | | ||
| GetTokenAsync | bool silentOnly = false, string[] scopes = null | Task<string> | Retrieve a token for the authenticated user. | | ||
| AuthenticateRequestAsync | HttpRequestMessage | Task | Authenticate an outgoing request. | | ||
| SignInAsync | | Task | Sign in a user. | | ||
| SignOutAsync | | Task | Sign out the current user. | | ||
| TrySilentSignInAsync | | Task<bool> | Try signing in silently, without prompts. | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should redirect the MsalProvider too, eh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did rename the MsalProvider, WindowsPRovider, and IProvider files. I'll add them to redirect as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some details on "redirect_document_id" property:
So based on this info, I also flipped all of the "return_document_id" values to
true
because they are caused by file renames, and not pointers to different articles.