Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
HTTP Authentication w/ jQGrid
16/01/2009
01:32
Avatar
davidmirv
New Member
Members
Forum Posts: 1
Member Since:
16/01/2009
sp_UserOfflineSmall Offline

Hi All,

I just discovered JqGrid and have been working extensively with it for the last few days and have found these forums to be an invaluable source of information, so I thought I would give something back.

The following code can be used to HTTP Auth protect your JSON/XML/ i/o script. 

First you must base64 encode the username:password like

var credentials = "<?php echo base64_encode("myusername:secretpassword");?> ";

In order to add the credentials into the request header you must implement the loadBeforeSendEvent in your jQGrid:

loadBeforeSend: function(xhr)

    {

     xhr.setRequestHeader("Authorization","Basic "+credentials);
     return xhr;

And thats it! it will login with the provided credentials! I believe if you wish to use Digest auth you just replace Basic with Digest but I am not 100% on that....

Thanks jQGrid Team, keep up the good work and thanks for a great widget!

David 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information