Want to get bearer token to connect to API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 05:54 AM - edited 10-01-2024 05:57 AM
Hi i want to get bearer token by providing client id and client secret to then connect the third party API.
In postman i can provide end point, client_id and client_secret(in headers) and get the following
"requested resource not found"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 07:52 AM
Hi @Kieran Anson , what type of application registry
Create an OAuth API endpoint for external clients
Create an OAuth JWT API endpoint for external clients
Connect to a third party OAuth Provider
Configure an OIDC provider to verify ID tokens.
Connect to an OAuth Provider (simplified)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 07:53 AM
Hi @Kieran Anson , what time of application registry
Create an OAuth API endpoint for external clients
Create an OAuth JWT API endpoint for external clients
Connect to a third party OAuth Provider
Configure an OIDC provider to verify ID tokens.
Connect to an OAuth Provider (simplified)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 07:55 AM
Hi @Kieran Anson , what type of application registry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 08:06 AM - edited 10-01-2024 08:07 AM
Hi @cloudv
Please use below code to get the refresh token
replace username and password with actual user name and password in code
var req = new sn_ws.RESTMessageV2();
req.setEndpoint("your_endpoint_here");
req.setHttpMethod("POST");
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.setRequestBody("grant_type=password&username=" + username + "&password=" + password + "&client_id=" + clientid + "&client_secret=" + clientsecret);
var response = req.execute();
if (response.getStatusCode() == 200) {
var parsedResponse = JSON.parse(response.getBody());
var refreshToken = parsedResponse.refresh_token;
}
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution
Thanks
Esh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 08:19 AM
Hi Esh, We don't have password or username we are using client id and client secret