如何在服务器端验证Gmail访问令牌

时间:2019-11-01 17:12:12

标签: javascript jquery model-view-controller c#-4.0 google-oauth2

我想在服务器上验证gmail访问令牌    (即在控制器的作用下)。     我可以通过以下代码获取访问令牌:

now I want to validate this access_token (received by onSignIn  
function) by c# code on sever side.
I am sending email id & access_token to the sever by ajax call. 
i have no idea what to do next , please help me. Thanks in advance

function onSignIn(googleUser) {
        var profile = googleUser.getBasicProfile();  
        idToken = googleUser.Zi.access_token
        id = profile.getId();
        console.log('ID: ' + profile.getId()); 
        console.log('Name: ' + profile.getName());
        console.log('Image URL: ' + profile.getImageUrl());
        console.log('Email: ' + profile.getEmail()); 
        ValidateAccessToken(id, idToken);
    }

0 个答案:

没有答案