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

Setting cookie from Response Header Set-Cookie #1242

Open
hasanheroglu opened this issue Feb 16, 2024 · 3 comments
Open

Setting cookie from Response Header Set-Cookie #1242

hasanheroglu opened this issue Feb 16, 2024 · 3 comments
Labels
binding-http Issues related to http protocol binding enhancement New feature or request

Comments

@hasanheroglu
Copy link
Contributor

Me and @egekorkan encountered with a case where we need to send session information to interact with a Thing. Therefore we thought, the token can be sent as a cookie, when security scheme is defined as below. In case there are no problems with this kind of logic, I can implement it.

"securityDefinitions": {
    "bearer1": {
      "scheme": "bearer",
      "in": "cookie",
      "name": "session_name"
    }
  },
"security":` "bearer1",
@egekorkan
Copy link
Member

Just some small clarifications:

  • session_name is custom per application so that will appear in TD but will be different each time.
  • We will use the credential storage with the same token config as usual:
servient.addCredentials({
    "urn:dev:wot:org:eclipse:thingweb:my-example-secure": {
        token: "1/mZ1edKKACtPAb7zGlwSzvs72PvhAbGmB8K1ZrGxpcNM"
    },
});
  • The session can expire so this needs to be adjusted over time. This is a use case for needing a more flexible credential storage but we can get around it for now

@danielpeintner
Copy link
Member

In case there are no problems with this kind of logic, I can implement it.

Did you already experiment/test it with node-wot?
I am curious to see what would need to change...

@egekorkan
Copy link
Member

I am curious to see what would need to change

Only binding-http should be affected, I think

@relu91 relu91 added enhancement New feature or request binding-http Issues related to http protocol binding labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding-http Issues related to http protocol binding enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants