0
votes

I'm connecting to a two-legged OAuth 2.0 service using Mule, but it seems the OAuth2 authentication annotation only supports a three-legged flow.

The call that needs to be made to authenticate is roughly: https://example.com/rest/oauth/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials

I'd like to take advantage of the access token management that comes with the default OAuth mule connector, but is this possible?

1

1 Answers

0
votes

As this grant type doesn't require redirection or callbacks, typically you just pass the credentials in as basic auth or in the POST body to a token endpoint.

You're better off using connection management features of Devkit and using a http client to call out to your token endpoint and store the token endpoint in the @Connect method:

http://www.mulesoft.org/documentation/display/34X/Implementing+Connection+Management