1
Answer

oauth login with google web api mvc

Photo of selvi jp

selvi jp

4y
539
1
<script src="~/Scripts/jquery-1.10.2.js"></script>
    <script>
        $(document).ready(function () {
            $('#btnGoogleLogin').click(function () {
                var clientId = '556152330944-jagrvefngh5t4g8d0lampg714oh7m73b.apps.googleusercontent.com';
                var redirectUrl = 'https://localhost:44327/Home/Login';
                window.location.href = 'https://accounts.google.com/o/oauth2/v2/auth?scope=openid&redirect_uri='+redirectUrl +
                    '& response_type=code &' +clientId +"Client ID"  ;
            });
        });
    </script>

Answers (1)