RAM OSLC REST: Am I authenticated?
Accepted answer
![](http://jazz.net/_images/myphoto/f1570fff80187e342e69951edc552bff.jpg)
There is no way to easily determine this. RAM itself doesn't tell you. This is just standard HTTP protocol. And standard HTTP protocol has no standard way of knowing this. All it does is it goes to the host and the host will send back an error code indicating not authenticated and it needs to be authenticated. Not all REST access requires authentication. A lot of it can be done anonymously, and only when you try to access something that requires authentication will the host determine if you are authenticated or not and will return an error indication authentication is needed. But there are no standard headers indicating that you are already authenticated.
Rich
Rich
4 other answers
![](http://jazz.net/_images/myphoto/f1570fff80187e342e69951edc552bff.jpg)
Authentication is not done on the (REST) service, but rather on the HTTP protocol. If you users ram.ws, you will be using basic authorization ... in this case, IF authorization is needed by the RAM server, and you are not authorized, then a 401 will be returned .. you will then need to send an Authorization header back.
In the case of form based, when/if authorization is needed by the RAM server, it will route you to a login page. Login information is help as part of your session on the server (pointed to by your session cookie).
In the case of form based, when/if authorization is needed by the RAM server, it will route you to a login page. Login information is help as part of your session on the server (pointed to by your session cookie).
![](http://jazz.net/_images/myphoto/f1570fff80187e342e69951edc552bff.jpg)
If you're using the web services path you can add RAMSecure to the URL and it will force you to authenticate if you're not already authenticated.
https://server/ram.ws/RAMSecure/
https://server/ram.ws/RAMSecure/
![](http://jazz.net/_images/myphoto/f1570fff80187e342e69951edc552bff.jpg)
Basically Gili is saying, there is no way to know from just looking at the headers whether you are authenticated or not. That information is not sent in the response. The session cookie does not mean you are authenticated, it simply means a session (which can be anonymous) has been established with the host.
![](http://jazz.net/_images/myphoto/f1570fff80187e342e69951edc552bff.jpg)
As Rich noted ... authentication information (who you are) is part of your session. RAM does not require one to authenticate ... as many resources may not need that. Only if you try to access something, and have no permission, RAM will start an authentication protocol (e.g., Form, oAuth ... etc.).
Sheehan mentioned above, that you can force that authentication dance by going to RAMsecure
Sheehan mentioned above, that you can force that authentication dance by going to RAMsecure