mulesoft/mule-devkit — Issue #68: Restoring access tokens doesn't work with OAuth2
Author: dandiep
Created: 2012-01-09 04:53:17+00:00
State: open

My config:

My connector:

@Module(name="google-contacts", schemaVersion="1.0",
namespace="http://www.mulesoft.org/schema/mule/google-contacts")
@OAuth2(authorizationUrl = "https://accounts.google.com/o/oauth2/auth",
accessTokenUrl = "https://accounts.google.com/o/oauth2/token",
callbackPath="oauth2callback",
accessTokenRegex= "\"access_token\" : \"([^&]+?)\"",
expirationRegex="\"expires_in\" : ([^&]+?),")

Devkit generates this in my authorize message processor:

if (castedModuleObject.getOauthVerifier() == null) {
String authorizationUrl = castedModuleObject.getAuthorizationUrl();
event.getMessage().setOutboundProperty("http.status", "302");
event.getMessage().setOutboundProperty("Location", authorizationUrl);
return event;
}
if (castedModuleObject.getAccessToken() == null) {
castedModuleObject.fetchAccessToken();
}

Does oauth2 even have a verifier? Regardless, it should recognize that I've already got my access tokens and restore.