How to get API key programmatically?

Issue #56 resolved
bmerry created an issue

I'm starting to look at using the Godocker API to allow another system to programmatically submit jobs (a workflow sort of system). From what I can see, one uses /authenticate to pass in an API key and get a session token to use for all the other requests, but how does one get the API key? From what I can tell, one has to log in to the web interface and look at the user info, but I'd prefer to be able to spin up a go-docker instance and submit work to it without requiring a human in the loop to validate the API key.

I'm not exactly sure yet what authentication plugin I'm going to use, but at least to begin with it will be either 'fake', or 'local' with a hard-coded password (it's all behind a firewall).

(By the way, is there a more appropriate place to ask questions than in bug reports?)

Comments (5)

  1. Olivier Sallou repo owner

    You should be able to "login" via web api and request user info to fetch api key. I do not have access rights now but will have a look.

    Bug reports are fine for questions for me.

  2. Olivier Sallou repo owner

    You can call /user/bind with params in POST query uid and password (to do a "real" login)

    in response you will get:

    then you can use token in authorization header for next requests (just like for api auth, Authorization: bearer token_value)

  3. Olivier Sallou repo owner

    by the way, avoid the fake auth anyway, this is for dev only. Use at least local for security reasons.

  4. Log in to comment