Skip to content

Google OAUTH2 #115

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

Closed
rrubio opened this issue Sep 27, 2017 · 2 comments
Closed

Google OAUTH2 #115

rrubio opened this issue Sep 27, 2017 · 2 comments

Comments

@rrubio
Copy link

rrubio commented Sep 27, 2017

Hi Guys,

Has anyone been able to use Google OAUTH2? I've tried referencing the following details onto the "auth.config.ts" but not having much luck.

https://accounts.google.com/.well-known/openid-configuration

@manfredsteyer
Copy link
Owner

Hi,

just tested it (after I've not used Google as an id provider directly for a while). It works.

You can try it out with the following config:

// This api will come in the next version

import { AuthConfig } from 'angular-oauth2-oidc';

export const googleAuthConfig: AuthConfig = {

  // Url of the Identity Provider
  issuer: 'https://accounts.google.com',

  // URL of the SPA to redirect the user to after login
  redirectUri: window.location.origin + '/index.html',

  // URL of the SPA to redirect the user after silent refresh
  silentRefreshRedirectUri: window.location.origin + '/silent-refresh.html',

  // The SPA's id. The SPA is registerd with this id at the auth-server
  clientId: '1004270452653-m396kcs7jc3970turlp7ffh6bv4t1b86.apps.googleusercontent.com',

  strictDiscoveryDocumentValidation: false,

  // set the scope for the permissions the client should request
  // The first three are defined by OIDC. The 4th is a usecase-specific one
  scope: 'openid profile email',

  showDebugInformation: true,
}

To test this, I've registered an application in the Google API Console. Its name is mentioned in the clientId property. I also had to set strictDiscoveryDocumentValidation to true.

Wishes,
Manfred

@ish-bindra
Copy link

https://medium.com/@ishmeetsingh/google-auth-integration-with-angular-5-and-angular-oauth2-oidc-ed01b997e1df

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

3 participants