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

[Google] Not possible to provide extra config for authorization #48

Closed
harlan-zw opened this issue Feb 7, 2024 · 1 comment
Closed

Comments

@harlan-zw
Copy link
Contributor

harlan-zw commented Feb 7, 2024

When authorizing with google, these params are hardcoded

response_type: "code",
client_id: config.clientId,
redirect_uri: redirectUrl,
scope: config.scope.join(" ")

However, several other options can be provided here. See https://developers.google.com/identity/protocols/oauth2/web-server#httprest_3

What is currently blocking me is access_type that allows you to specify offline, which is the only way to get a refresh_token, which is the only way to keep the user logged in for more than 1 hour (when they need to access Google APIs).

Maybe an option like useRuntimeConfig(event).oauth.google.authorizationParams

config: {
    redirectUrl: '/auth/google',
    scope: [
      'https://www.googleapis.com/auth/userinfo.email',
    ],
    authorizationParams: {
      prompt: 'consent',
      access_type: 'offline',
    },
  },
@atinux
Copy link
Owner

atinux commented Feb 17, 2024

Closing as duplicate of #22

@atinux atinux closed this as completed Feb 17, 2024
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