Forum Discussion

PSAmmirata's avatar
PSAmmirata
Employee
6 years ago

REST OAuth2 Account - 'Client Credentials' grant type

I’m working with an application that supports ‘Client Credentials’ and ‘Authorization Code’ grant types in the authorization request; however, doesn’t support refresh tokens. What is the value of selecting the ‘Client Credentials’ grant type in the REST OAuth2 Account? Does the REST OAuth2 Account make the authorization request and get the token when the first document enters the REST snap that’s using the account? What’s the purpose of the ‘Authorize’ button when the grant type is ‘Client Credentials’ since the token will expire at some point? Is it just to validate that the account has been configured correctly?

I have the same questions if the grant type is ‘Authorization Code’ and the api doesn’t support refresh tokens.

17 Replies

  • dmiller's avatar
    dmiller
    Former Employee

    I have created an account with Client Credentials and when the access token expires, I use Authorize to manually grant me a new token.

    An issue has been submitted for refresh of Client Credentials.

  • Since I have a need to run my pipeline as a scheduled task it’s not feasible to use the SnapLogic REST OAuth2 Account and manually/periodically click on ‘authorize’ to get a new access token. If there’s a way to automate the periodic authorization in such a way that makes the new access token available to pipelines that want to use it please let me know.

    In lieu of that workaround/solution we’re adding a REST Post snap to explicitly make the authorization request and get the access token as part of the pipeline. The drawbacks that I can see are that the client id, secret, and access token are not secure like they would be in the REST OAuth2 Account. Also, if we have more than one pipeline running at a time that make an authorization request using the same client ID, it’s possible that one pipeline may make an authorization request that causes the access token of another pipeline to become invalid.

    • mramaswamy's avatar
      mramaswamy
      New Contributor II

      I am working on a similar app where I am not getting the Refresh Token. Will you be able to share the REST Post snap you are using for the authorization request?

      • PSAmmirata's avatar
        PSAmmirata
        Employee

        Hi Murugan - I’m sorry, but my company’s policies prevent me from sharing the pipeline.

    • sanjaynayak's avatar
      sanjaynayak
      New Contributor III

      Hi,
      Hope you are doing well! Would you mind helping to check why same oauth2 is working for one node but not for other node after march 11 release
      It was working fine for both the node before this, all of sudden it stoped working and we are getting 500 error messages on authorize button click.

  • dmiller's avatar
    dmiller
    Former Employee

    @PSAmmirata I’m in discussions with Dev on this as I’m also working with an app with no refresh token.

  • mramaswamy's avatar
    mramaswamy
    New Contributor II

    Yes. I tried that but I am not getting any Refresh Token when I authorize in the account creation. When did we solve this problem?

  • mramaswamy's avatar
    mramaswamy
    New Contributor II

    Sorry for a delayed response. My bearer token is refreshed even though I don’t get a refresh token while creating the account. Thanks for all your help.