Reputation: 370
I'm working on setting up a Microsoft flow that will need to access a registered web app, which utilizes oAuth2 authentication. The purpose of this would be to obtain a JWT access token that will be used to access the protected API in the web app. I don't have a lot of experience with Microsoft Flow so I'm wondering how one would login through Auth2 with Username/Password and retrieve the token.
Upvotes: 6
Views: 28513
Reputation: 370
I was able to solve this using custom connectors. If you don't have 2FA setup on your account, Hury's answer works just as well.
Upvotes: 0
Reputation: 15734
You just need to use "HTTP" connector to get the access token and use this token to request your app. Please refer to the steps below:
https://login.microsoftonline.com/{your tenantId}/oauth2/v2.0/token
For this step, you can refer to this tutorial, and I think you have already known how to get the access token by OAuth 2.0 resource owner password credentials grant in postman.
Please replace the {tenantId} and xxxxx above with your own information.
After running this Microsoft flow, we can get the access token successfully.
If you want to use this access token in the following actions in your Microsoft flow, you can use "Parse JSON" action to parse the response body from the HTTP action and then use the access token(shown as below screenshot)
Upvotes: 8