Question: How can I find a user API key using the bioblend library?
1
gravatar for Thibaut Guirimand
2.5 years ago by
INRA
Thibaut Guirimand50 wrote:

Hi !

I'm working on a python application who interact with a Galaxy server. For this purpose, I use the library bioblend to communicate with galaxy.

To start a job or get a user history, I have to use the user API key. I can generate it for the new users but, for users who already have an account, an API key could already exist. Currently I known how to find the username, the email and the user ID using the administrator API key.

How to find the API key if she already exists?

bioblend • 885 views
ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Thibaut Guirimand50
2
gravatar for Thibaut Guirimand
2.5 years ago by
INRA
Thibaut Guirimand50 wrote:

Using the Martin Čech answer, here is a little portion of the code to access to the api key when the email and the password are known :

import requests

url = "http://galaxy.server:8080/api/authenticate/baseauth"
response = requests.get(url, auth=(email, password))

if response.status_code == 200:
    api_key = response.json()['api_key']

It seems that we can't use digest method to send authentication request to Galaxy. It would be a securest way to communicate.

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Thibaut Guirimand50
2
gravatar for Martin Čech
2.5 years ago by
Martin Čech ♦♦ 4.9k
United States
Martin Čech ♦♦ 4.9k wrote:

It seems not to be a part of bioblend but the Galaxy API for the key retrieval exists here It uses standard BaseAuth so if you use something like requests in your py code you should be able to obtain it easily.

ADD COMMENTlink written 2.5 years ago by Martin Čech ♦♦ 4.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 172 users visited in the last hour