This is a migrated thread and some comments may be shown as answers.

[Solved] http://login:password@mysite.com did not work on Android

1 Answer 49 Views
AppBuilder Windows client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Денис
Top achievements
Rank 1
Денис asked on 12 Mar 2015, 10:40 AM
Hi

I try connect to restricted area (htpasswd auth) of my site via

$.ajax( {
            url: "http://login:password@my.site.com/restricted"
})

construction

All works excellent in simulator but Android client get 401 response with same login and password

Looks like missed permissions or something other stuff but I can't fugure it out

Help please!

1 Answer, 1 is accepted

Sort by
0
Денис
Top achievements
Rank 1
answered on 12 Mar 2015, 03:07 PM
Fixed!

Add this to ajax options

    headers: {
            'Authorization': "Basic " + btoa(login+ ":" + password)
    },
Tags
AppBuilder Windows client
Asked by
Денис
Top achievements
Rank 1
Answers by
Денис
Top achievements
Rank 1
Share this question
or