-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add endpoint for authentication info #552
Comments
Thanks @sebastian-raubach, Yes I think this would be very beneficial. I've been hesitant in the past to do something like this because there are many different pieces of info you might need depending on what the exact auth protocol is. For example, when you say username/password, is that through a Basic auth token or credentials posted to an endpoint or some other HTTP header values. Bottom line, I think you are right, it would be helpful to add what type of Auth scheme is being used, and perhaps a URL for more details depending on what scheme. But I don't want to get carried away trying to support every possible auth scheme, and neither should you attempt to do that in Flapjack. Choose the auth schemes you can support, and try to get others to conform. I can help with that if you have any uncooperative server teams |
There are more auth schemes available, but off the top of my head, this is what I'm thinking. I bet we could cover 90% of use cases if the server could respond with one of these things
|
I probably should create another ticket with a question, but.. @BrapiCoordinatorSelby, |
@nahuel-soldevilla Some groups may choose the "Basic Auth" protocol where the username and password are Base64 encoded into a token. That is one of the reasons why OAuth2/OIDC is so powerful, it hands off control of the login mechanics, and it doesn't care what the user has to do to authenticate as long as you get a token back. |
Since @sebastian-raubach raised the subject today on Slack, it made me think about it again. I'm fine with "externalizing" the authentication process (I do it in my implementation). But the question was "how a BrAPI client application would tell her/his user to login somewhere and then get back the token so the user wouldn't have to do some copy & paste?" In my case (Drupal implementation), if the BrAPI client behaves like a web browser and support cookies, it can display the Drupal login page and my implementation of the BrAPI server gets the access token (bearer) from both the HTTP header and the Drupal session object (if not found in the header). So, my implementation would work with such a client but it's something too specific. A more generic way would be better. Something like a login URL provided to the client by the /serverinfo call. That URL should be web interface using cookies, so the BrAPI client should also be supporting cookies and it could then use another URL to get the access token. It is something that needs to be think and discussed a little more as there might be some issues with cookies but here's how I would see a first (perfectible) approach:
Again, "brainstorming mode". Feel free to propose alternatives or point the approach weakness. ;-) |
@guignonv haha no need for alternatives or points of weakness because you are just re-inventing OAuth hahaha
|
:) Yup, I love to reinvent the wheel! :0) No worries, I've already implemented applications using oauth (and even an ancestor) and I definitely know how it works! Thanks. :D Since it seemed too complicated for some clients to use oauth, I tried to propose a different approach but not much simpler, I have to agree ...but it would simplify "my implementation" since it's already there like that. For OAuth, I need to add a Drupal module to the server. Not big deal but an additional dependency. Anyway, I support the approach you gave above. |
Currently, it's up to the BrAPI provider to handle authentication, some will use OAuth, others may use username/password login with Bearer tokens or something else entirely.
While everyone agrees, that BrAPI should not handle the authentication itself, I think it would be hugely beneficial if BrAPI at least provided information about what authentication mechanism is used along with any necessary information to be able to authenticate using that other service. This would make it possible for client applications to query the BrAPI server and find out what authentication mechanism is used to then authenticate using that information.
Whether this is something that could go into
/serverinfo
or if it should go somewhere else and what exactly the structure of the result should be, I don't know, but I think it's something worth discussing.The text was updated successfully, but these errors were encountered: