Skip to content
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

Added a client consumption example #18463

Merged
1 commit merged into from
Feb 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sdk/mixedreality/Azure.MixedReality.Authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ token from the STS that can be used to access Mixed Reality services.
- [MixedRealityStsClient](#mixedrealitystsclient)
- [Examples](#examples)
- [Retrieve an access token](#retrieve-an-access-token)
- [Using the access token in a Mixed Reality client library](#using-the-access-token-in-a-mixed-reality-client-library)
- [Troubleshooting](#troubleshooting)
- [Next steps](#next-steps)
- [Client libraries supporting authentication with Mixed Reality Authentication](#client-libraries-supporting-authentication-with-mixed-reality-authentication)
Expand Down Expand Up @@ -159,6 +160,24 @@ AccessToken token = await client.GetTokenAsync(accountId);

See the authentication examples [above](#authenticate-the-client) for more complex authentication scenarios.

#### Using the access token in a Mixed Reality client library

Some Mixed Reality client libraries might accept an access token in place of a credential. For example:

```csharp
// GetMixedRealityAccessTokenFromWebService is a hypothetical method that retrieves
// a Mixed Reality access token from a web service. The web service would use the
// MixedRealityStsClient and credentials to obtain an access token to be returned
// to the client.
AccessToken accessToken = await GetMixedRealityAccessTokenFromWebService();

SpatialAnchorsAccount account = new SpatialAnchorsAccount(accountId, accountDomain);
SpatialAnchorsClient client = new SpatialAnchorsClient(account, accessToken);
```

Note: The `SpatialAnchorsClient` usage above is hypothetical and may not reflect the actual library. Consult the
documentation for the client library you're using to determine if and how this might be supported.

## Troubleshooting

- See [Error Handling](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/README.md#error-handling) for Azure.Identity.
Expand Down