-
Notifications
You must be signed in to change notification settings - Fork 91
Update Auth0 documentation #1565
Comments
Thanks @Welliton309 for putting together such a detailed set of instructions! Auth0 was in the process of testing the API based non-interactive clients features and I haven't tried them out. The It sounds a bit like that is what is going wrong, the callback code does looks well formed, but you're being redirected to the Are you trying to log in using an email in the authorized users list? The returned information about the email used to perform the login attempt has to match what is in the local configuration. |
I have used the same email. I tested again and it worked! I don't known what happened. I got the API Token web page. The link to landing page worked very well 😄 The Apache access log:
It seems that the token size has been changed and the server redirected to |
Thanks, we would happily incorporate any of your tutorial into our docs! |
@david4096 feel free to use this tutorial :) I updated with more information and pictures. Now I am trying to retrieve data from server. |
Great, I changed the title. We'll close this issue once we've updated our documentation using your screenshots. Thanks! |
@david4096 I'd like you to wait until I can access the data. There may still be settings to make on the Auth0 page. |
Unfortunately it is not working. It seems that the GA4GH server only accept connection to base URL. When trying to access another resource such as search for data sets the server raises the "Not authenticated. Use the key on the server index page." Basically I am running this: from ga4gh.client import client
key = "<key from login page>"
c = client.HttpClient("http://192.168.0.8/", id_token=key)
c.search_datasets().next() Anyone have any idea for tracking this problem? |
Are there any more details of the error message? In order to control for issues in the client, could you try it as a cURL request (replacing my key for yours)?
Let me know the details of the error returned please! It seems like the flow with Auth0 of getting a token for your login works as expected. However, protected endpoints inspect the
|
I did the following steps:
It returned:
The access.log file:
The error.log file (server debug activated):
First log from Auth0 (successful login):
Second log from Auth0 (successful exchange):
Let me know if there are any other log files that might help. |
Thanks that's very helpful! Given that the exchange with Auth0 is working and I believe some id_token is in the cache, my guess is something is going wrong here. The authorization token is decoded using the client_id and secret in order to authenticate the request. Perhaps it is suggesting the token is not present in the header in the expected way. The other possibility is here. Do you have the OIDC configured as well? It should leave that function if the OIDCClient is None, which it will be as long as the configuration setting OIDC_PROVIDER isn't set. |
I didn't set an
|
@Welliton309 I just tried this with my credentials, which I include for testing and was able to get it to work. Then I tried creating a new app and it seems like they have changed the formatting of the keys. If you'd like to start up a server with these credentials (over some non-protected data!), it would help me to be certain this is the problem. This application was created before their changes and is apparently grandfathered into the old style.
I believe all new created apps at Auth0 will have the new formatting. Related https://auth0.com/forum/t/client-secret-stored-without-base64-encoding/4338 The fix is quite simple, remove the b64decode of the client secret. I'll issue a PR for this. Such are the woes of supporting a third party service! |
With external links to images Close ga4gh#1565
With external links to images Close ga4gh#1565
With external links to images Close ga4gh#1565
With external links to images Close ga4gh#1565
With external links to images Close ga4gh#1565
I am trying to figure out how to configure a working example of GA4GH server with Auth0 authentication service. I am using the latest release version (0.3.5). Because Auth0 service should be configured via web browser, I created a step-by-step tutorial with my progress. I think the following pictures and text may help others. The problem I found is at the end of this text.
Follow the Deployment on Apache instructions to install the reference implementation server.
At Apache configuration, you should use the root path instead of
/ga4gh
because the server is using absolute path when redirecting web address.Configuring Auth0 service
First login or sign up in Auth0 website: https://auth0.com/
Creating Client
On tab
Client
click inCreate Client
. Give a name for your Client and choose theNon Interactive Clients
client type. ClickCreate
.In
Settings
tab copy theDomain
,Client ID
andClient Secret
data.These data will be used to set the following server configuration values (reference):
AUTH0_HOST
withDomain
;AUTH0_CLIENT_ID
withClient ID
;AUTH0_CLIENT_SECRET
withClient Secret
.Fill
Allowed Callback URLs
,Allowed Logout URLs
andAllowed Origins (CORS)
with the web address of server endpoint plus the related path.Creating API
Go to
APIs
tab and click inCreate API
. TheIdentifier
should be the URL of server endpoint (the landing page). For this example I am using root path and TCP port 80.On
Scopes
tab, create two scopes:openid
andemail
.On
Non Interactive Clients
tab, authorize the previous created Client. Select both scopesopenid
andemail
. ClickUpdate
thenContinue
.Creating Database Connections
Go to
Connections-Database
tab and clickCreate DB Connection
. I disabled sign ups because I want to have control over user creation allowing only certain people/software to have access on server.In
Clients
tab, activate the connection between the Client and the Database.Creating Users
Go to
Users
tab and clickCreate User
. Fill the fields.Connection
should be same one previously created. An email will be send requesting to verify. I recommend creating your own user for testing purposes.Setting up GA4GH server with authentication
Append the following server configuration values to
config.py
file (reference). Remember to update the fields correctly. Create a SECRET_KEY. I didn’t understand the fieldAUTH0_AUTHORIZED_EMAILS
. I just used the same email I used to login into Auth0 website.Restart the server.
Testing
Finally access server landing page. It will show an error and a link to login. At login page, use the same email and password used to create a user. Note that it does not have an option to create a user (it can be changed).
After login you will see the token page.
Issues
It seems that Auth0 returned access token to
/callback
but it redirected to/login
again. It happens sometimes requiring to restart Apache server.Using
ga4gh_client
tool:Using
--key
argument does not work.Using Python library (reference):
Error:
The text was updated successfully, but these errors were encountered: