-
Notifications
You must be signed in to change notification settings - Fork 5
WIP: Authorization of Delphi Management at Instance Registry #109
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
Conversation
|
@johannesduesing or @sami-cseseu , could one of you please have a look into the usage of the authentication by @Ayybeeshafi ? I believe it's easier for you to judge if there has been a mistake there. @Ayybeeshafi in general thank you for your work, the code looks good so far. A few general points for the pull request. This branch is obviously not ready to be merged, since the intended functionality is not working properly yet. If you know that before and still decide to open the pull request, please add the appropriate labels, like help wanted and best make it obvious in the title, so that this request is not merged by mistake (the "WIP" I added to the title stands for "Work in Progress" and is often used to mark pull requests not ready for merging). A quick note to your code. Shouldn't the authenticate method be automatically called after starting the scala play server? The registration of the scala server as a component is independent of any user interaction on the website and therefore I don't see any need to provide this as an api endpoint right now, or am I mistaken here? |
|
I actually helping @Ayybeeshafi to integrate it with API of delphi-registry we set together in Friday and I showed him how he has to do the request. He is facing a little difficulty setting up database without database user he will not get any token. He did this pull request without informing me what the problem he is facing. I think we will fix this issue soon. |
|
hey @sami-cseseu , When you say 'we will fix this issue soon', does that mean it's an issue in the registry and the behavior of the code on the management side is fine so far? |
|
Hello @janniclas I am not sure what the delphi-management wants to achieve but /authenticate end point need a basic authorization where you need to pass username, password which should match username and password of database |
|
Hi @sami-cseseu I am looking into the database right now. Before sending them via Authorization header I am converting them into Base64 (BasicAuth) So in header it actually looks something like |
Codecov Report
@@ Coverage Diff @@
## develop #109 +/- ##
==========================================
- Coverage 4.69% 4.52% -0.17%
==========================================
Files 11 12 +1
Lines 213 221 +8
Branches 15 17 +2
==========================================
Hits 10 10
- Misses 203 211 +8
Continue to review full report at Codecov.
|
|
I thought of the interaction like this:
@janniclas Is this how you think it should be ? |
|
The database is set and ready on my machine. Still, the curl command is returning " invalid credentials ". Maybe there is some problem with the formatting of curl command. So now I am trying to run the authenticate method at startup of scala play server. There is some confusion on how to call a method at startup. Which I intend to get cleared in the morning. |
Everything seems to be in place. Still, I am facing an issue. I am not sure if its Instance Registry side issue or Delphi Management.
While hitting
/authenticateendpoint using CLI commands. On CLI I get a response "The supplied authentication is invalid".Whereas, on the logs of IR It says "Successfully parsed Delphi Token" and "Valid Delphi token"
I have generated the Basic Auth and JWT tokens using online tools to make CURL request to IR with following parameters:
BasicAuth
username:admin
password:admin
JWT Authorization:
user_id:DelphiManagement
user_type:Component
Following is the CURL request from CLI:
curl -X POST -H "Authorization:Basic YWRtaW46MTIzNDU=" -H "Delphi-Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiRGVscGhpTWFuYWdlbWVudCIsInVzZXJfdHlwZSI6IkNvbXBvbmVudCJ9.dPxLDxQfnKRNpoNE9TMi9R4iU1-xl7SugDNxI0gwGNU" http://localhost:8087/authenticate