8000 Only send the raw string ID token value to Unity by onevcat · Pull Request #64 · line/line-sdk-unity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only send the raw string ID token value to Unity #64

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

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

onevcat
Copy link
Member
@onevcat onevcat commented Dec 8, 2023

Problem

In a previous version, when user wants to get the ID token, iOS and Android returns different things for AccessToken.IdTokenRaw in the API calling below:

var scopes = new string[] {"profile", "openid", "email"};
LineSDK.Instance.Login(scopes, result => {
    result.Match(
      value => {
        Debug.Log(value.AccessToken.IdTokenRaw);
      },
      error => {}
    );
});

On iOS, it gives the valid raw value of ID Token, such as:

// iOS: Debug.Log(value.AccessToken.IdTokenRaw);
eyJraWQi.....

However, on Android, it is a JSON that represents the parsed ID token, including the raw value:

// Android: Debug.Log(value.AccessToken.IdTokenRaw);
{"issuer": "https://access.line.me", "subject": ... , "rawString": "eyJraWQi...."}

Considering that the property indicates a IdTokenRaw, the correct behavior should be the iOS one, and the SDK user can easily gets the raw string and send it to either their own server or LINE's verification server to verify the ID Token.

In this PR

Only sending the rawString part to Unity, so the behavior on Android can be aligned to iOS.

With this PR, now both iOS and Android gives the same result on IdTokenRaw:

// Debug.Log(value.AccessToken.IdTokenRaw);
eyJraWQi.....

@onevcat
Copy link
Member Author
onevcat commented Dec 8, 2023

Related to #61

Copy link
Member
@plateaukao plateaukao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor
@tsairene tsairene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@onevcat onevcat merged commit e3f87b6 into master Dec 8, 2023
@onevcat onevcat deleted the fix/plain-id-token-raw-android branch December 8, 2023 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0