Skip to content
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

add oauth verify api #291

Merged
merged 1 commit into from
Oct 29, 2021
Merged

add oauth verify api #291

merged 1 commit into from
Oct 29, 2021

Conversation

4geru
Copy link
Contributor

@4geru 4geru commented Jul 25, 2021

add verify api.
https://developers.line.biz/en/reference/line-login/#oauth

i'd like to check verify liff access token, and revoke.

lib/client.ts Outdated
@@ -679,6 +679,24 @@ export class OAuth {
return this.http.postForm(`${OAUTH_BASE_PREFIX}/revoke`, { access_token });
}

public verifyAccessToken(access_token: string): Promise<{}> {
Copy link
Member

Choose a reason for hiding this comment

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

There's response why {} ?

Copy link
Contributor Author

@4geru 4geru Aug 6, 2021

Choose a reason for hiding this comment

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

I just referenced revokeAccesstoken API method.
What do you want to return value?
Do it expect expires_in?

lib/client.ts Outdated
client_id: string,
nonce: string = undefined,
user_id: string = undefined,
): Promise<{}> {
Copy link
Member

Choose a reason for hiding this comment

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

also here

#### `revokeAccessToken(access_token: string): Promise<{}>`

It corresponds to the [Revoke channel access token](https://developers.line.biz/en/reference/messaging-api/#revoke-channel-access-token) API.
It corresponds to the [Revoke channel access token](https://developers.line.biz/en/reference/line-login/#revoke-access-token) API.
Copy link
Member

Choose a reason for hiding this comment

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

👍

@xingoxu
Copy link
Member

xingoxu commented Aug 6, 2021 via email

lib/client.ts Outdated
public verifyIdToken(
id_token: string,
client_id: string,
nonce: string = undefined,
Copy link
Member

Choose a reason for hiding this comment

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

maybe just nonce?: string

Copy link
Member

Choose a reason for hiding this comment

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

@4geru sann
Would you please change it to

nonce?: string,
user_id?: string

@4geru
Copy link
Contributor Author

4geru commented Oct 28, 2021

@xingoxu Sorry for the delay. nonce and user_id are now supported. Please review again.

@@ -21,7 +22,13 @@ class OAuth {
client_id: string,
client_secret: string,
access_token: string,
): Promise<{}>
): Promise<Types.VerifyAccessToken>
Copy link
Member

Choose a reason for hiding this comment

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

Types.VerifyAccessToken maybe wrong places?

@@ -66,9 +73,19 @@ It corresponds to the [Issue channel access token](https://developers.line.biz/e
const { access_token, expires_in, token_type } = await oauth.issueAccessToken("client_id", "client_secret");
```


#### `verifyAccessToken(access_token: string): Promise<{}>`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#### `verifyAccessToken(access_token: string): Promise<{}>`
#### `verifyAccessToken(access_token: string): Promise<Types.VerifyAccessToken>`

@4geru 4geru requested a review from xingoxu October 29, 2021 02:45
@xingoxu xingoxu merged commit ccac1b0 into line:next Oct 29, 2021
@xingoxu
Copy link
Member

xingoxu commented Oct 29, 2021

Thank you very much!

@4geru
Copy link
Contributor Author

4geru commented Oct 29, 2021

@xingoxu thank you for the review.

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.

2 participants