Inrego 76 Posted March 9, 2018 Posted March 9, 2018 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.
ebr 15667 Posted March 9, 2018 Posted March 9, 2018 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.
Inrego 76 Posted March 11, 2018 Author Posted March 11, 2018 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now