


Hi,
I think you are confusing GitHub user level access with app level access. For OAuth integration between GitHub and 3rd party app you should use GitHub App feature https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app . It uses JWT tokens instead of custom resource tokens you are getting.
--
Vilius
Thanks.
On Thursday, April 13, 2023 at 11:59:25 AM UTC+5:30 Sudhanshu Joshi wrote:
Hi Marcial,
Thanks for your reply.
To answer your first question, if I have been able to configure my OAuth Client with RabbitMQ scopes. I could not do this as I could not find any option to do so in GitHub. I tried the example you have given for Azure AD and there we can define the RabbitMQ scopes for the users or groups, but nothing like that in GitHub.
I have tried to use the "oauth_provider_url" as "https://token.actions.githubusercontent.com/". So in this case, the yellow error message disappears, but when you click on the "Click here to login" button, the console has the error which you mentioned regarding the "authorization_endpoint" missing. I have attached the screenshot also for your reference.
2. I use this link to authorize the app to access my GitHub account.
https://github.com/login/oauth/authorize?client_id=XXXX&redirect_uri=https://localhost:15672&scope=user:email
3. After successful authorization, it redirects me back to my RabbitMQ management UI with a code embedded in the URL. Using this code, I am able to generate an API token by making a post request to the GitHub API with the following body:
{
"client_id" : "XXXX",
"client_secret" : "XXXX",
"redirect_uri" : "http://localhost:15672/oauth2/github/callback",
"code" : "code_received_from_step2"
}
And I receive a token of the form like below:
access_token=gho_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&scope=user%3Aemail&token_type=bearer
4. Now when making a curl command to the RabbitMQ HTTP management API using the above generated access code, it does not get authorized.
Can anyone help me out in implementing this use case. Also, I could not find any tutorials for the integration of RabbitMQ with GitHub OAuth. If there is one, can you please point me to it.
Thanks,
Sudhanshu Joshi
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/rabbitmq-users/502c4a0a-c6ec-4249-8a69-a678cb8f3b72n%40googlegroups.com.
Glad you have sorted this out. I‘ve only ever done GitHub App integration with software which provides scope/app_id/etc. in the integrated manner, but THIS will be useful to me too some point in the future.
Thanks.
On Thursday, April 13, 2023 at 11:59:25 AM UTC+5:30 Sudhanshu Joshi wrote:
Hi Marcial,
Thanks for your reply.
To answer your first question, if I have been able to configure my OAuth Client with RabbitMQ scopes. I could not do this as I could not find any option to do so in GitHub. I tried the example you have given for Azure AD and there we can define the RabbitMQ scopes for the users or groups, but nothing like that in GitHub.
I have tried to use the "oauth_provider_url" as "https://token.actions.githubusercontent.com/". So in this case, the yellow error message disappears, but when you click on the "Click here to login" button, the console has the error which you mentioned regarding the "authorization_endpoint" missing. I have attached the screenshot also for your reference.
2. I use this link to authorize the app to access my GitHub account.
https://github.com/login/oauth/authorize?client_id=XXXX&redirect_uri=https://localhost:15672&scope=user:email
3. After successful authorization, it redirects me back to my RabbitMQ management UI with a code embedded in the URL. Using this code, I am able to generate an API token by making a post request to the GitHub API with the following body:
{
"client_id" : "XXXX",
"client_secret" : "XXXX",
"redirect_uri" : "http://localhost:15672/oauth2/github/callback",
"code" : "code_received_from_step2"
}
And I receive a token of the form like below:
access_token=gho_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&scope=user%3Aemail&token_type=bearer
4. Now when making a curl command to the RabbitMQ HTTP management API using the above generated access code, it does not get authorized.
Can anyone help me out in implementing this use case. Also, I could not find any tutorials for the integration of RabbitMQ with GitHub OAuth. If there is one, can you please point me to it.
Thanks,
Sudhanshu Joshi
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/502c4a0a-c6ec-4249-8a69-a678cb8f3b72n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/5b5c9d9c-4bf8-43d9-b64b-9aa5abc16c36n%40googlegroups.com.