Skip to content
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

Unable to configure client settings or credential settings #9

Closed
hidetak opened this issue Mar 4, 2024 · 7 comments
Closed

Unable to configure client settings or credential settings #9

hidetak opened this issue Mar 4, 2024 · 7 comments

Comments

@hidetak
Copy link
Contributor

hidetak commented Mar 4, 2024

Currently, the arguments of the *Server class (e.g., HttpServer class) constructor can be specified in the Binding config of the wot-server-config node, as shown in the screenshot below.
image

If I understand correctly, the user would also need to configure the following settings.

  1. Server credential settings (settings to be specified on the server side in the argument of the servient.addCredentials method)
  2. Client settings (Setting to be specified in the argument of the constructor of *ClientFactory)
  3. Client credential settings (settings specified by the argument of the client.addCredentials method on the client side)

I think the credential for 1 is set for each Thing, so I would like to add a form to specify the credential and Thing ID to the following configuration screen for each Thing.

image

I would appreciate it if you could point out if my understanding is incorrect.

@egekorkan
Copy link
Member

Client credential settings (settings specified by the argument of the client.addCredentials method on the client side)

This is not exactly correct. Server or Client, credentials are always added to the servient, which can have client and/or server sides.

I think the credential for 1 is set for each Thing, so I would like to add a form to specify the credential and Thing ID to the following configuration screen for each Thing.

This makes sense. Just for username and password, you need two fields and for token only one field.

@hidetak
Copy link
Contributor Author

hidetak commented Mar 5, 2024

@egekorkan
Thanky you for your comment!

Client credential settings (settings specified by the argument of the client.addCredentials method on the client side)

Sorry, there was a mistake.
client.addCredentials method -> servient.addCredemtials method

This makes sense. Just for username and password, you need two fields and for token only one field.

I was going to allow the flexibility to define it in JSON as well as Server config, but will consider it.
Thanks for the advice.

@hidetak
Copy link
Contributor Author

hidetak commented Mar 5, 2024

I have created a sample to see how to use the authentication feature of Binding HTTP.

https://github.com/hidetak/test-node-wot/tree/main/auth-http/src

If you notice anything, I would be happy to point it out.

@hidetak
Copy link
Contributor Author

hidetak commented Mar 12, 2024

PR #10 now supports Basic authentication only.

In this case, I have prepared an input form specifically for Basic Auth, and have made the necessary settings in ServerConfig and Servient.addCredentials.
Therefore, I believe that it is not generic and that the program will need to be modified for each authentication method.

I would appreciate it if you could let me know if there is any discrepancy in this policy.
And if there are other high priority certifications, I would like to consider them.

@egekorkan
Copy link
Member

If you notice anything, I would be happy to point it out.

@hidetak this looks good :) @danielpeintner this would be useful in the readmes of HTTP binding no?

@danielpeintner
Copy link
Member

@danielpeintner this would be useful in the readmes of HTTP binding no?

@egekorkan what do you mean exactly?

I think there is a secure example in HTTP, see https://github.com/eclipse-thingweb/node-wot/tree/master/packages/binding-http#server-example

  • first a non secure one and
  • a second example how to secure the server

egekorkan added a commit that referenced this issue Mar 24, 2024
Add td nodes (issue #8) and enable basic auth (issue #9)
@egekorkan
Copy link
Member

Done via #10

@danielpeintner what I had meant was a client-server pair available above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants