Jump to content

Get current user in server plugin


Inrego

Recommended Posts

Inrego

In my IService endpoint, I want to get currently signed in user (as in the user making the request). Is it possible? Currently, I am sending UserId in as a parameter, but it's not quite optimal this way.

Link to comment
Share on other sites

Why is that not optimal?

 

It is pretty much the only way to do it because the server itself has no "current user".  Requests made to your service need to be on the behalf of whatever user is required.

Link to comment
Share on other sites

Inrego

Intercepted requests could change the user ID. It's not really a problem in reality. My question was more around the thoughts that when calling the api, I have to authenticate as a user - and thus I was thinking that the current user must be available somehow on the server side. Since that's not possible, I will just continue sending in the user id, as it's not really a problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...