Skip to content

Why don't all logged-in Request objects have a token field? #140

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

Closed
michielbdejong opened this issue Aug 11, 2021 · 7 comments
Closed

Why don't all logged-in Request objects have a token field? #140

michielbdejong opened this issue Aug 11, 2021 · 7 comments

Comments

@michielbdejong
Copy link
Contributor

I see the WhoAmIRequest lets you specify the token which you received from AuthenticateResponse, but none of the other method Request objects do.

I see revad throws "core access token not found" when you try to do for instance a ListReceivedOCMShared call.
Is there another way to pass the token in a grpc request?

@michielbdejong
Copy link
Contributor Author

@michielbdejong
Copy link
Contributor Author

Sending a token header combined with insecure channel credentials is not supported by the node implementation of grpc.
I'll find out how the go client does it. Maybe it adds the x-access-token header in an interceptor, instead of through officia l grpc credentials?

@michielbdejong
Copy link
Contributor Author

Hm, it seems that https://github.com/cs3org/reva/blob/v1.11.0/pkg/sdk/session.go#L125-L127 sets the header when communicating over http, but how does it get set when communicating over grpc?

@michielbdejong
Copy link
Contributor Author

@michielbdejong
Copy link
Contributor Author

Not sure why it calls both ContextSetToken and AppendToOutgoingContext

@michielbdejong
Copy link
Contributor Author

https://stackoverflow.com/a/37551218/680454 should do something similar in node.

@michielbdejong
Copy link
Contributor Author

Yes! OK, I got it now, will create a PR to update https://github.com/cs3org/node-cs3apis#example-usage.

michielbdejong added a commit to cs3org/node-cs3apis that referenced this issue Aug 11, 2021
The existing example didn't show how to set the `x-access-token` header, so it was not really usable.

See also cs3org/cs3apis#140.
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

1 participant