Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<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