Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a simple and documented way to set auth token #118

Open
byrnereese opened this issue Aug 27, 2019 · 3 comments
Open

Need a simple and documented way to set auth token #118

byrnereese opened this issue Aug 27, 2019 · 3 comments

Comments

@byrnereese
Copy link
Contributor

The API Reference supports a "Try it out" feature which allows someone to copy-and-paste a code sample that just works. This system works well for cURL requests because the framework is able to insert the HTTP Bearer token directly into the "code sample." However, we cannot do that with any specific language because there is not a clear/obvious way to initialize the client/SDK with an already-existant token.

Screen Shot 2019-08-26 at 5 51 56 PM

We need a simple and single API call for getting the Bearer token in this SDK. Something to the effect of:

sdk.platform().auth().setData(...)

If a capability like this already exists, then can we add that to the documentation?

Acceptance criteria includes the very subjective criteria of the solution not feeling like a "hack." It should not feel like the developer is going into set the value via a backdoor, but by setting it via a public and sanctioned manner.

@Brutalbeard
Copy link
Contributor

Old issue but that method does exist, however it requires the full OAuth token response.

If the user on service web could see that full response they could use exactly the code you show in your issue.

@FlandersBurger
Copy link

Is there anything the needs to be done after the auth token is set with setData?
I don't know where to go after executing this function

@byrnereese
Copy link
Contributor Author

Once you have seeded the SDK with a valid access key, then no, there is nothing more you need to do except to begin using the SDK to make API calls.
I personally recommend authenticating using JWT. So easy, and you don't need to set the access key using setData.
https://developers.ringcentral.com/guide/authentication/jwt/quick-start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants