Guest User

Untitled

a guest
Jun 5th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. $('#btnLogin').click(function () {
  2. $.ajax({
  3. // Post username, password & the grant type to /token
  4. url: '/token',
  5. method: 'POST',
  6. contentType: 'application/json',
  7. data: {
  8. username: $('#txtUsername').val(),
  9. password: $('#txtPassword').val(),
  10. grant_type: 'password'
  11. },
  12. //response(Access Token) stores inside session storage of Client browser.
  13. success: function (response) {
  14. sessionStorage.setItem("accessToken", response.access_token);
Add Comment
Please, Sign In to add comment