I am new to programming, trying to learn to work with API's. I'm using the standard OAuth to connect to our PureCloud enviroment (https://developer.mypurecloud.com/api/tutorials/oauth-implicit/?language=javascript&step=1). The logon is working fine, but I keep getting the following error on the redirect: This Page does not exist. I see this error within the PureCloud Admin page.
Perhaps a stupid question, but what should the redirect_uri point to, and what should it contain? Googled a lot, but can't really find a proper answer. Even when I enter https://google.com as redirect, I get the same error, while I would just expect it to open Google?
When you initiate an implicit or token auth flow, you provide a redirect URI with that request. After the user authenticates successfully, they will be redirected to the provided redirect URI, provided it exactly matches one of the redirect URIs configured on the oauth client. This prevents malicious apps from hijacking your auth flow and redirecting the user to a malicious site afterwards.
The user will be redirected to the redirect URI provided. If you use a fake URL, the user will be redirected to that fake URL. You should use the URL of your application that will handle the auth redirect and grab the access token.
Thanks. I now get logged on, but I get see the following error: Failed to load resource: the server responded with a status of 401 (Unauthorized)
console.log(location.hash); is in the code. This logs the following in the console: #access_token=HANDLE_ACCESS_TOKENS_LIKE_PASSWORDS&expires_in=86399&token_type=bearer
Is this the correct syntax? The "&expires_in=86399&token_type=bearer" shouldn't be in there, should it?
Access tokens must be handled like passwords. Posting your access token publicly allows anyone access to your org. Please take steps to secure this user's account and your org immediately.
401 means you didn't send a valid access token with the API request.