Skip to content

Instantly share code, notes, and snippets.

@marianogonzalez
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogonzalez/8945304 to your computer and use it in GitHub Desktop.
Save marianogonzalez/8945304 to your computer and use it in GitHub Desktop.
<google-contacts:config-with-oauth name="Google_Contacts" consumerKey="${consumerKey}" consumerSecret="${consumerSecret}">
<google-contacts:oauth-callback-config domain="localhost" localPort="${https.port}" path="oauth2callback" connector-ref="https.connector" />
</google-contacts:config-with-oauth>
<objectstore:config name="tenantStore" partition="tenants" persistent="true" />
<flow name="authorize">
<https:inbound-endpoint path="authorize" port="${https.port}" exchange-pattern="request-response" />
<flow-ref name="loadTenantInformation" />
<google-contacts:authorize config-ref="Google_Contacts" />
<choice>
<when expression="flowVars['GOOGLE_USER_EMAIL'] != flowVars['tenantInfo']['email']">
<flow-ref name="rejectAndReportInvalidAuth" />
</when>
<otherwise>
<logger message="successfully authorized tenant" />
</otherwise>
</choice>
</flow>
<sub-flow>
<enricher target="#[flowVars['tenantInfo']]">
<objectstore:retrieve config-ref="tenantStore" key="#[message.inboundProperties['cookies']['tenantId']]" />
</enricher>
</sub-flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment