Forum Discussion
Hai iarriola
Basically for getting an authorization code below one is url:
https://community.example_community.com/auth/oauth2/authorize?client_id=CbEwDo2NtAhXLSt4Y49D1yVE9D371eyZFWRSSXvNLvA=&response_type=code&redirect_uri=http%3A%2F%2Fredirect.example_community.com%2FgetaccessToken
https://community.lithium.com/auth/oauth2/authorize?client_id=CbEwDo2NtAhXLSt4Y49D1yVE9D371eyZFWRSSXvNLvA=&response_type=code&redirect_uri=http%3A%2F%2Fredirect.example_community.com%2FgetaccessToken
But you are giving https://api.stage.lithium.com instead of this one community.example_community.com .Give your community name at above URL it will work.
Give kudos if you find my posts helpful or mark solution if it answers your query
Quick question: For server-to-server calls, is there a programmatic way (an endpoint perhaps) to logon an API user?
Context: In order to make the authorize endpoint work, the following should be done:
1. Using a browser, manually logon to the community site as an API user
https://community.example_community.com/
2. Paste the URL in the browser
https://community.example_community.com/auth/oauth2/authorize?client_id=<urlEncodedClientId>&response_type=code&redirect_uri=<urlDecodedRedirectURI>
3. Once submitted, note that the request has been redirected and the browser now shows authorization code as 'code'.
https://community.example_community.com?code=<urlEncodedCode>&user-id=<userId>&tenant-id=<tenantId>&proxy-host=<proxyHost>
I'd like to skip Step 1 (the manual part where the user needs to logon as an API user.) Is there a REST endpoint for logging in? Thanks!
- DougS7 years agoKhoros Oracle
You could alternatively use Session Key Authentication to get a REST API session key and use that in subsequent API calls you mean (REST V1 or V2).
-Doug
- joylim7 years agoContributor
In that case, I need to create a user account (that has a user id, password, and email) for an application. How does the client id, and client secret tie all into this, in that case? I tested using clientId as userId and clientSecret as password but it didn't work. It really does seem that I need to have an email address tied to my application. Pls. confirm. Thanks!
- DougS7 years agoKhoros Oracle
If you use Session Key Auth, you use it instead of OAuth, so none of the OAuth stuff (client id, client secret, etc.) apply. I think you can create an api user via the admin (Users > Create Users tab I think), but this might be something that Support needs to do for you (if you don't see that tab, contact support to have them create the user for you). You have to supply username, password, and email address when you create the user.
Related Content
- 2 years ago