LA_
LA_

Reputation: 20419

How to keep 3rd party's site credentials with GAE?

My GAE site should communicate with 3rd party site (i.e. should use it's API). That 3rd party site requires HTTP Digest Authentication. To support that I use the following header, it works well:

headers={'Authorization': 'Basic %s' % base64.b64encode('login:pass')}

How can I check if authorization on that side is still valid and if it is not, how should I ask user to input login and pass again?

Upvotes: 0

Views: 83

Answers (1)

Nick Johnson
Nick Johnson

Reputation: 101149

If the authentication details are not valid, the site will return a 401 Unauthorized response. The only way to check for validity is to make a request - any request - and see if you get a 401.

How you prompt the user for updated credentials depends entirely on your application, how it's designed, and who your users are.

Upvotes: 1

Related Questions