Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. X-CSRF-TOKEN ...
  2.  
  3. index.module.js
  4.  
  5. (function() {
  6. 'use strict';
  7.  
  8. var username = '**********';
  9. var password = '**********';
  10.  
  11. angular
  12. .module('app', [
  13. ...
  14. ])
  15. .config(function($httpProvider){
  16. $httpProvider.defaults.headers.common['Authorization'] = btoa(unescape(encodeURIComponent(username + ':' + password)));
  17. })
  18.  
  19. .run(['drupal', function(drupal){
  20.  
  21. drupal.userLogin(username, password).then(function() {
  22.  
  23. alert(drupal.currentUser());
  24. });
  25.  
  26. GET http://drupal.lan/user/1 403 (Forbidden)
  27.  
  28. Accept:*/*
  29. Accept-Encoding:gzip, deflate, sdch
  30. Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
  31. Connection:keep-alive
  32. Content-type:application/x-www-form-urlencoded
  33. Host:drupal.lan
  34. Origin:http://evil.com/
  35. Referer:http://192.168.50.100:3000/?
  36. User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement