Unity Firebase Authentication retrieve id token after sign in with Apple

399 views Asked by At

I made a feature where user can sign in Apple in Android using Unity Firebase. The code is:

        var providerData = new FederatedOAuthProviderData
        {
            ProviderId = "apple.com"
        };
        var provider = new FederatedOAuthProvider();
        provider.SetProviderData(providerData);
        await auth.SignInWithProviderAsync(provider).ContinueWith(task =>
        {
            var result = task.Result;
        });

my question is: how to retrieve apple id token from task.Result ?

edit: the data return contains 2 parts:

  1. user info

    { "PhotoUrl": null, "DisplayName": "", "Email": "[email protected]", "IsAnonymous": false, "IsEmailVerified": true, "Metadata": { "LastSignInTimestamp": 1660117698962, "CreationTimestamp": 1660116775373 }, "PhoneNumber": "", "ProviderData": [ { "PhotoUrl": null, "UserId": "elba7GqsGccUvQiYnEZr5KTtHlv2", "Email": "[email protected]", "DisplayName": "", "ProviderId": "firebase" }, { "PhotoUrl": null, "UserId": "000435.d5a5ca436f7645f992af1e1cc4d8e97b.0728", "Email": "[email protected]", "DisplayName": "", "ProviderId": "apple.com" } ], "ProviderId": "firebase", "UserId": "elba7GqsGccUvQiYnEZr5KTtHlv2" }

  2. extra info { "Profile": { "at_hash": "W89x3Dkr7ri-mMHu2bHdiw", "aud": "com.m.obirix.mbgk.web", "auth_time": 1660117696, "email": "[email protected]", "email_verified": "true", "exp": 1660204098, "iat": 1660117698, "iss": "https://appleid.apple.com", "nonce_supported": true, "sub": "000435.d5a5ca436f7645f992af1e1cc4d8e97b.0728" }, "ProviderId": "apple.com", "UserName": "", "UpdatedCredential": { "Provider": "" } }

0

There are 0 answers