Forum Discussion
I see that you have the extension specified in postman, is that required for your particular instance? If not, you can just use the OAuth2 Account within the REST snap pack as it has a grant type of password that you can use. It seems the only missing item at that point would be the ability to get the endpoint_id back from the request, if that’s an important step, it might be worth looking into the authorization_code flow in their documentation as that seems to not require the additional parameters in the body of the password grant flow. Again, this can be achieved with the REST OAuth2 Account. It also looks like they provide an OpenAPI specification, so you could use the appropriate account type for the Open API Snap to potentially achieve the same thing, assuming you’re able to get it working in the REST OAuth2 Account
Thanks for your response. That entry is actually not selected. The extension can be concatenated to the username( a phone number in this case) and passed with the username at that point. That is what I am currently doing in that snapshot you see above.
I am trying to get an OAuth2 account working in this case. The app in Ring Central does not provide a redirect URL, which if I understand correctly, rules out the option of authorization_code flow. I am trying to get it to authorize using the password flow but I get an error string in a new tab. See below.
{“response_map”: {“error_list”: [{“message”: “Request from platform.devtest.ringcentral.com returned an error (response code: 400, response: {\n "error" : "invalid_client",\n "errors" : [ {\n "errorCode" : "OAU-123",\n "message" : "Client authentication is required"\n } ],\n "error_description" : "Client authentication is required"\n})”}]}, “http_status_code”: 500}
Do you know what I might be missing? Again please forgive my lack of knowledge in this area.
- ddellsperger4 years agoAdmin
redirect_uri is what is provided for SnapLogic to respond, in this case, it would likely be (in the rest account) https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest which redirects back to the base url for snaplogic to complete the next step of the auth. If you move to openAPI, you’ll replace
rest
withopenapi
. The REST OAuth2 Account documentation has it right at the top under Account Settings, it’s quite a bit confusing here because in this case you may not know what a POD is.- jsmith1414 years agoNew Contributor III
So if I understand you correctly, it sounds like there really should have been a place on the RingCentral side to add a redirect url? I did check several times because I expected there to be one as well, but never saw an option to enter a redirect url.
- jsmith1414 years agoNew Contributor III
I added the redirect_uri argument to both the token and auth endpoint config sections using the uri you provided above.
When I click on the authorize button it looks like it is successful. A tab is temporarily opened and closed(it appears blank for its entire short duration on screen) and then the access token, refresh token, and Access token expiration are all populated. The first two are indicated to be encrypted and the expiration is a long numeric string.
However, when I go to validate the pipeline I get a long wait and then an error on the rest get snap which reads…
Failure: Error reading account, Reason: Snapi request failed: {“response_map”: {“error_list”: [{“message”: “Request from platform.devtest.ringcentral.com returned an error (response code: 400, response: {\n "error" : "unauthorized_client",\n "errors" : [ {\n "errorCode" : "OAU-251",\n "message" : "Unauthorized for this grant type"\n } ],\n "error_description" : "Unauthorized for this grant type"\n})”}]}, “http_status_code”: 500}
The only thing I can see is that it is possible that the client id and client secret are not being passed as expected by RingCentral (i.e. concatenated together as client_id+‘*’+client_secret and then the whole thing is base64 encoded). Does this account type take care of that in the background, or is the issue something else entirely? I do see in the error that there is an “Unauthorized for this grant type”, but I am successfully using that grant type in Postman.
Thanks,
James- ddellsperger4 years agoAdmin
I created a RingCentral account yesterday, but haven’t been able to get a Sandbox account up and running. I did get to the point in the provision where login takes place and I can share some screenshots there, but here’s the screenshot of my account on the SnapLogic side (it’s a REST OAuth 2 Account)
On the RingCentral side, you’ll want to set your application to be a 3-legged application with redirect_uri being the previously mentioned uri (https://elastic.snaplogic.com/api/1/rest/admin/oauth2callback/rest
).
This will bring up a RingCentral login prompt for you to fill out with your (I believe) sandbox account, and then it should be able to get a token back from the token endpoint. Again, I haven’t been able to get a Sandbox account created through RingCentral, so I can’t validate this on my side.Our OAuth2 Account will follow the Auth code flow semantics directly that they specify here. You’ll need to check the box at the bottom of the account that specifies Sending Client Data as Basic Auth header, that’s talked about in the “Step 3. Exchange auth code for access token” section. Once it authorizes properly, you’ll want to then check the box that says “Auto-refresh token” in our snap account configuration, as that will continually refresh the token behind the scenes so that you don’t have to perform the login screen piece any more.