You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi;
thank you for your great post and sample code.
but I am a bit frustrated replicating this for Google.
how can I check and verify the token that we got from our angular app?
in this part
// 1.generate an app access token
var appAccessTokenResponse = await Client.GetStringAsync($"https://graph.facebook.com/oauth/access_token?client_id={_fbAuthSettings.AppId}&client_secret={_fbAuthSettings.AppSecret}&grant_type=client_credentials");
var appAccessToken = JsonConvert.DeserializeObject<FacebookAppAccessToken>(appAccessTokenResponse);
// 2. validate the user access token
var userAccessTokenValidationResponse = await Client.GetStringAsync($"https://graph.facebook.com/debug_token?input_token={model.AccessToken}&access_token={appAccessToken.AccessToken}");
var userAccessTokenValidation = JsonConvert.DeserializeObject<FacebookUserAccessTokenValidation>(userAccessTokenValidationResponse);
if (!userAccessTokenValidation.Data.IsValid)
{
return BadRequest(Errors.AddErrorToModelState("login_failure", "Invalid facebook token.", ModelState));
}
// 3. we've got a valid token so we can request user data from fb
var userInfoResponse = await Client.GetStringAsync($"https://graph.facebook.com/v2.8/me?fields=id,email,first_name,last_name,name,gender,locale,birthday,picture&access_token={model.AccessToken}");
var userInfo = JsonConvert.DeserializeObject<FacebookUserData>(userInfoResponse);
// 4. ready to create the local user account (if necessary) and jwt
how can I implement these 4 steps for google?
I used every method described in google OAuth document but there was no luck.
I'll be grateful if you help me with this.
The text was updated successfully, but these errors were encountered:
hi;
thank you for your great post and sample code.
but I am a bit frustrated replicating this for Google.
how can I check and verify the token that we got from our angular app?
in this part
how can I implement these 4 steps for google?
I used every method described in google OAuth document but there was no luck.
I'll be grateful if you help me with this.
The text was updated successfully, but these errors were encountered: