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

OAUTH2 AZURE SCOPE #1

Open
jbeaujour opened this issue Oct 22, 2021 · 4 comments
Open

OAUTH2 AZURE SCOPE #1

jbeaujour opened this issue Oct 22, 2021 · 4 comments

Comments

@jbeaujour
Copy link

Hello
I'am trying to use your plugin for a web site on AZURE with login.microsoftonline.com authentication
I always have: Error getting access_token, http_code != 200, http_code: 400
I put this information :
--url 'https://[MY_SITE]/api/path'
--client_id '[APP CLIENT ID]'
--scope '/subscriptions/[TENANT]/resourceGroups/[RGR]/providers/Microsoft.Web/sites/[RESOURCE]'
--client_secret '[CLIENT SECRET]'
--grant_type 'client_credentials'
--auth_url 'https://login.microsoftonline.com/[TENANT]/oauth2/v2.0/token'
--oauth2
Is that correct ?
Thank's for help

@jbeaujour jbeaujour changed the title SCOPE OAUTH2 AZURE SCOPE Oct 22, 2021
@jbeaujour
Copy link
Author

Hello Pablo @pablodav
I modify my requests because of new results:

  • it is Moodle website on prem who redirect to login.microsoftonline.com for the authent
  • When it's done, it redirect to the Moodle site
    My args to curlnagios
    --url 'https://[MY_SITE]
    --oauth2
    --auth_url 'https://login.microsoftonline.com/[TENANT]/oauth2/v2.0/token'
    --grant_type client_credentials
    --client_id '[APP CLIENT ID]'
    --scope https://graph.microsoft.com/.default
    --client_secret '[CLIENT SECRET]'
    --extra_args "--location-trusted --post303 --user 'email:password' --trace-ascii /tmp/jmb.log"

With this parameters i obtain a token bearer but it redirect me to login.microsoftonline.com without push email and password

Do you think it's possible to add extra args to resolve this probblem ?

@pablodav
Copy link
Owner

pablodav commented Dec 1, 2021

Hi @jbeaujour
Thanks for writing this issue, sorry to not reply before but my time is very limited these days.

I think any extra arg is possible to add, but it is not clear for me what arg is needed to be added.
Did you try to get it working directly with curl? actually this script uses curl command line directly, so extra args are same for curl.

@jbeaujour
Copy link
Author

Hi @pablodav
thank's for the reply
After the redirect by the moodle site to login.microsoftonline.com, it's like a form with "email" with commit and then "password" fields with commit. After authent it's redirect to the moodle site.
I don't try with curl

@pablodav
Copy link
Owner

pablodav commented Dec 1, 2021 via email

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

2 participants