Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
HD-Chapter:Security
-
HD-Enabler:KeyRock
Description
Created question in FIWARE Q/A platform on 20-03-2015 at 11:03
Please, ANSWER this question AT http://stackoverflow.com/questions/29164371/fiware-oauth2-authentication-in-python
Question:
FIWARE OAuth2 Authentication in Python
Description:
I am trying to authenticate user using FIWARE.
It returns a 404. Thus fails at Step 1 itself. What is the access token url ? Any other pointers to check
I have tried variations with 'oauth/access_token', 'oauth/token' 'oauth2/token' 'oauth2/access_token' . All of them dont seem to work.
My Code is Below:
import oauth2 as oauth
- OAuth secret into your project's settings.
consumer = oauth2.Consumer(settings.FIWARE_CLIENT_ID,settings.FIWARE_CLIENT_SECRET)
client = oauth2.Client(consumer)
access_token_url = 'https://account.lab.fiware.org/oauth2/access_token'
- This is the slightly different URL used to authenticate/authorize.
authenticate_url = 'https://account.lab.fiware.org/oauth2/authorize'
def fiware_login(request):
- Step 1. Get a request token from FIWARE.
resp, content = client.request(access_token_url, "GET")
print resp
if resp['status'] != '200':
print content
raise Exception("Invalid response from FIWARE.")
- Step 2. Redirect the user to the authentication URL.
url = "%s?access_token=%s" % (authenticate_url,
resp['access_token'])
return HttpResponseRedirect(url)
Activity
Fix Version/s | 2021 [ 12600 ] |
HD-Enabler | KeyRock [ 10889 ] | |
HD-Chapter | Security [ 10841 ] |
Summary | FIWARE.Request.Lab.Security.IDM-KeyRock.Authentication in Python | FIWARE.Request.Tech.Security.IDM-KeyRock.Authentication in Python |
Summary | [fiware-stackoverflow] FIWARE OAuth2 Authentication in Python | FIWARE.Request.Lab.Security.IDM-KeyRock.Authentication in Python |
Assignee | Alvaro Alonso [ aalonsog ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |