8000 Send nil if the nonce setting is missing by onevcat · Pull Request #63 · line/line-sdk-unity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Send nil if the nonce setting is missing #63

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 7, 2023

If not set, LineSDKMakeNSString still converts a null value to an empty string, that causes an empty ID token nonce to be set in the auth URL when performing the request. In this case, the result ID token is lack of a nonce field, which fails the verification.

This fixes #62 and also maybe #61

Before

The login will fail due to ID Token verification with this code (if requesting an ID token but not setting the nonce):

var scopes = new string[] {"profile openid"};
LineSDK.Instance.Login(scopes, result => {
     // handle the result
});

FYI

A workaround in the old version, is setting your own nonce:

var scopes = new string[] {"profile openid"};
var option = new LoginOption();
option.IDTokenNonce = "abc123";

LineSDK.Instance.Login(scopes, option, result => {
     // handle the result
});

Now with this PR

The same code can work and a random strong nonce will be set in the native part, if not in the Unity side.

@onevcat onevcat merged commit 057faf8 into master Dec 8, 2023
@onevcat onevcat deleted the fix/missing-nonce-setting branch December 8, 2023 01:46
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.

Failed Login due to CryptoError in LINE SDK on Unity
3 participants
0