I am using this github project https://github.com/openiddict/openiddict-core which is great. But I stick to what procedures should be or how to implement them when the user uses an external identity provider. In this example, I will use Google.
I have an angular2 application working with the basic aspnet webAPI. All my local logins work fine, I call connect/tokenwith username and password, and accessToken is returned.
Now I need to implement google as an external identity provider. I followed all the steps here to implement the Google login button. This will open a popup when the user logs in. This is the code I created for my google button.
ngAfterViewInit() {
if (document.querySelector("meta[name='google-signin-client_id']")) {
gapi.signin2.render(
'google-login-button',
{
"onSuccess": this.onGoogleLoginSuccess,
"scope": "profile",
"theme": "dark"
});
}
}
onGoogleLoginSuccess(loggedInUser) {
let idToken = loggedInUser.getAuthResponse().id_token;
}
Now I have idToken from google. The next step on the google pages found here says that I need to check the google accessToken, what can I do, but how can I exchange the accessToken that I have from google and create local access for access that can be used in my application?
source
share