dotnet / dotnet/docs-maui

Missing information on how to commence once having the Apple IdToken

Open
#2,035 5 comments 0 reactions 0 assignees View on GitHub
doc-idea dotnet-maui/subsvc dotnet-mobile/svc Pri1
Dominant language
No language data
Stars
282
Forks
265
Avg merge
2d 2h
Merged PRs (30d)
19

Description

### Type of issue

Missing information

### Description

The [Apple Sign In](https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?view=net-maui-8.0&tabs=macios#apple-sign-in) section mentions correctly that Apple does indeed not return an AccessToken and only an IdToken.

```
// Note that Apple Sign In has an IdToken and not an AccessToken
authToken += result?.AccessToken ?? result?.IdToken;
```
What is missing now is directions on where to go from here.

Apple Sign In uses the native sign in and not a web authenticator - as mentioned in the beginning of the example:
```
// Use Native Apple Sign In API's
result = await AppleSignInAuthenticator.AuthenticateAsync();
```
This means that - apart from with other providers such as Google auth - there is no redirect to a backend. The client gets the response directly and the IdToken.

Now the need to somehow obtain a JWT accesstoken remains in order to apply this as a Bearer token to all the future requests to the Api.

It's not kosher to generate a JWT client-side (something I also tried without managing to get the backend to accept the token), so I would like to know your suggestions on how to move forward with this.

### Page URL

https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication?view=net-maui-8.0&tabs=android

### Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/platform-integration/communication/authentication.md

### Document Version Independent Id

829bc017-4a10-6ca5-0717-e1e62f59aacc

### Article author

@davidbritch

### Metadata

* ID: 829bc017-4a10-6ca5-0717-e1e62f59aacc
* Service: **dotnet-mobile**
* Sub-service: **dotnet-maui**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.