question

Kağan avatar image
Kağan asked

When I use LoginWithApple I get "NotAuthorized" error

Hello, I am using PlayFab plugin on Unreal Engine 5. I am getting id_token using Apple REST api and when I connect this identifier token to "LoginWithApple" node I get error(CreateAccount = true). The error is as follows:

LogPlayFab: Response : {"code":403,"status":"Forbidden","error":"NotAuthorized","errorCode":1089,"errorMessage":"IDX12709: CanReadToken() returned false. JWT is not well formed: 'eyJraWQiOiJm... I do not share this part for security ...EU6Oht5VfIg'. The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.Encoded InitializationVector.EncodedCiphertext.EncodedAuthenticationTag'."}

I went through all the documentation, there are articles about similar errors, but I couldn't come to a conclusion.

appleAuthentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Kağan avatar image
Kağan answered

5398-id-token-jwt.png


id-token-jwt.png (51.3 KiB)
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kağan avatar image Kağan commented ·

The content of the "id_token" that I got as login with Apple. (https://jwt.io/)

0 Likes 0 ·
Neils Shi avatar image Neils Shi Kağan commented ·

You can try the solution of this post,he used the Encoding.UTF8.GetString instead of Convert.ToBase64String to get the string from the appleIdCredential.IdentityToken, and it works. If it doesn't work, please feel free to tell me.

0 Likes 0 ·
Kağan avatar image Kağan Neils Shi commented ·

I looked at the article you mentioned. GetContentAsString() converts to UTF8 as far as I've checked. However, just to be sure, I converted the TArray returned with GetContent() to String as follows.

FString ByteEncode(const TArray& buffer)

{ return UTF8_TO_TCHAR(buffer.GetData()); }

Unfortunately the result is the same. Also, as I mentioned, when I checked the id_token I copied from the log in jwt.io, it seems there is no problem.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.