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

README needs to explain Machine to Machine Applications authorization #610

Open
5 tasks done
alvincrespo opened this issue Aug 21, 2024 · 1 comment
Open
5 tasks done
Labels
bug This points to a verified bug in the code

Comments

@alvincrespo
Copy link

alvincrespo commented Aug 21, 2024

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

When trying to create a client and having the proper grants enabled for my application, I still came across this error:

{"error":"access_denied","error_description":"Client is not authorized to access \"https://dev-x3r4mfeuopyc566w.us.auth0.com/api/v2/\". You need to create a \"client-grant\" associated to this API. See: https://auth0.com/docs/api/v2#!/Client_Grants/post_client_grants"} (Auth0::AccessDenied)

This was my implementation of the client:

client = Auth0Client.new(
  client_id: Rails.application.credentials.auth_zero.client_id,
  client_secret: Rails.application.credentials.auth_zero.secret,
  domain: Rails.application.credentials.auth_zero.domain,
)

I re-read the README and missed this part: "and that the application is authorized for the Management API". I assumed that enabling the grant did this as well. After doing some research, I came across this issue that explained the need to authorize the application under "Machine to Machine Applications" in APIS.

This should probably be added to the README as:

To authorize your application for the Management API, please visit Applications > APIs > Machine to Machine Applications and then toggle the Authorize button for the application you're integrating with.

Reproduction

  1. Configure the grant for the application
  2. Create the Ruby client
  3. [Failure]

Additional context

No response

ruby-auth0 version

5.17.0

Ruby version

3.2.2

@alvincrespo alvincrespo added the bug This points to a verified bug in the code label Aug 21, 2024
@alvincrespo
Copy link
Author

I'll be submitting a PR for this later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

1 participant