
DevT.31586 (Customer) asked a question.
I have an application(Alexa Skill) I developed that uses Okta for authentication. Once a user authenticates to Okta, can I use their token to programmatically access other Okta-enabled apps (sugarCRM) via API?....so could i use the same token to access sugarCRM API's?
note: the app doesn't have UI involved so it's not browser related, it's just telling alexa to push get or push some data into Sugar

Yes you can use that Token, as long as the Token is valid. Just use the Introspect API to check the validity of the token before you use it in another App. that should work.
Thanks for the response, I already linked the okta authentication server with the Alexa skill and also using the Introspect API but keep getting this error.
{
"error": "access_denied",
"error_description": "The requested feature is not enabled in this environment."
}
any idea why? or how i can solve this issue
are you using the OKTA preview account for testing ? or Is it a customer instance with URL --->
Try changing the OktaConfig’s issuer field from XXX.okta.com/oauth2/default to XXX.okta.com it might fix the issue. since all samples have the oauth2 and default parts at the end of the path and no mention that that is different on okta vs oktapreview.
This is what i'm using,
var optionspost = {
host: '**your okta org**.oktapreview.com',
port: 443,
path: '/oauth2/**your authorization server id**/v1/introspect' + tokenQuery,
method: 'POST',
headers: {
'Authorization': auth,
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded'
}
Should i just leave the host to host: '**your okta org**.com, and have no path?
just try removing /auth2/default from the issue url & I hope it should work. what is the authorization server ID for your OKTA org ? I am sure it is not the default one , you are using.
here is the link to your problem. I hope this will resolve the issue.
https://support.okta.com/help/s/article/400-error-on-authentication-to-Okta-using-OIDC?_ga=2.141099058.1425712666.1593178110-914471284.1577149045