Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#btnLogin').click(function () {
- $.ajax({
- // Post username, password & the grant type to /token
- url: '/token',
- method: 'POST',
- contentType: 'application/json',
- data: {
- username: $('#txtUsername').val(),
- password: $('#txtPassword').val(),
- grant_type: 'password'
- },
- //response(Access Token) stores inside session storage of Client browser.
- success: function (response) {
- sessionStorage.setItem("accessToken", response.access_token);
Add Comment
Please, Sign In to add comment