Hi Karthik,
That page about authentication, while part of the REST v1 documentation, does touch on Authentication for REST v2 (v2 authentication over HTTP requires you to use OAuth 2.0 and it links out to OAuth 2.0 documentation in another article).
We are working towards making OAuth 2.0 the standard and I encourage people to try it out if they can. However, we currently only support the "Authorization Grant" flow and that does not always mesh with specific API use-cases (it requires a web browser to sign into the community to get authorized).
The /authentication/sessions/login call, and the REST v1 Session key it returns will only work for REST v1 (REST v2 requires OAuth. You can make authenticated REST v1 and REST v2 calls using OAuth).
If you want to use only REST v1, you can use the /authentication/sessions/login call. If you do that, since you are not using Lithium SSO, you will not be able to use the sso.authentication_token parameter, as that requires a Lithium SSO token as the value. You may want to create a non-SSO API account to make your REST v1 calls with. If you do that, then you will pass that account's login and password to the /authentication/sessions/login call as the values of the user.login and user.password parameters.
You can also use REST v1 Session Key you get back from the result of the /authentication/sessions/login call to authenticate when you can an endpoint. You can combine REST v1 and REST v2 calls in your endpoint (or use one or the other).
You can make REST v1 or REST v2 calls without an OAuth 2.0 Access token, or a REST v1 call without a REST v1 session key and you will be making the call as an anonymous user. Provided you have granted the appropriate default permissions through the Lithium Admin, the calls you make as an anonymous user will return results (but will exclude any results that default permissions do not allow anonymous users to see).
I hope that answers your questions, and understand if any of it is confusing - please ask additional questions for clarification if you have them.
Thanks,
-Doug
... View more