1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    1
    jhennard is on a distinguished road

      0  

    Default Basic Authentication

    Basic Authentication


    I would like to send basic authorization headers when using the save method on a model. Does anyone know what the correct approach is?

    My initial attempt...

    model.save({
    headers: {
    'Authorization': 'Basic ' + Base64.encode('username:password')
    },
    username: 'username',
    password: 'password',
    withCredentials: true
    });

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    584
    Vote Rating
    32
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    The way I use it is by just setting the headers (as you do) and making sure that it's a POST. Setting username and password again is not necessary in my case.

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    33
    Vote Rating
    2
    vnggui is on a distinguished road

      0  

    Default where can we find Base64?

    where can we find Base64?


    I run Base64.encode('user:password'), but throws :
    Uncaught ReferenceError: Base64 is not defined

    Where can we find Base64?

    thanks,

    vng


  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    584
    Vote Rating
    32
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0