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

feat: nonce & response_type: 'id_token' support s #90

Open
reslear opened this issue Oct 1, 2024 · 1 comment
Open

feat: nonce & response_type: 'id_token' support s #90

reslear opened this issue Oct 1, 2024 · 1 comment
Milestone

Comments

@reslear
Copy link
Contributor

reslear commented Oct 1, 2024

part of

https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow

and need for example sui zklogin enoki

https://github.com/MystenLabs/sui/blob/b516d265b27ff69f8fe37946c7c50b522de5e7ac/sdk/enoki/src/EnokiFlow.ts#L123-L126

@kasvith kasvith added this to the v3.0.0 milestone Nov 21, 2024
@reslear
Copy link
Contributor Author

reslear commented Nov 28, 2024

i found code:

so it turns out it's implemented, but in a button:

  • nonce - seta as button prop
  • id_token - is response.credential in @success cb.
<script>
const nonce = ref('')

// handle success event
const handleLoginSuccess = async (response: CredentialResponse) => {
  // response.credential is id_token!
  console.log('id_token=' + response.credential)
}

// handle an error event
const handleLoginError = () => {}
</script>

<template>
  <GoogleSignInButton
    v-if="nonce"
    :nonce="nonce"
    @success="handleLoginSuccess"
    @error="handleLoginError"
  ></GoogleSignInButton>
</template>
  • So necessary to do it using the usual method for a custom button.

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

No branches or pull requests

2 participants