Skip to content

Instantly share code, notes, and snippets.

@albinkjellin
Last active August 29, 2015 14:17
Show Gist options
  • Save albinkjellin/7f16948114f486ddb32e to your computer and use it in GitHub Desktop.
Save albinkjellin/7f16948114f486ddb32e to your computer and use it in GitHub Desktop.
Sample Code for checking session token
<flow name="policy.stub">
<http:listener config-ref="HTTP_Listener_Configuration"
path="/inbound" doc:name="HTTP" />
<logger message="#[sessionVars.tokenName]" level="INFO"
doc:name="Logger" />
<enricher doc:name="Message Enricher" source="#[payload.isValid]" target="#[flowVars['isValid']]">
<processor-chain doc:name="Processor Chain">
<http:request config-ref="HTTP_Request_Configuration"
path="validate" method="GET" doc:name="HTTP" />
<json:json-to-object-transformer
returnClass="java.util.Map" doc:name="JSON to Object" />
</processor-chain>
</enricher>
<choice doc:name="Choice" >
<when expression="">
<http:request config-ref="HTTP_Request_Configuration1" path="internal" method="GET" doc:name="HTTP"/>
</when>
<otherwise>
<logger message="Token not valid. Generate error codes!" level="INFO" doc:name="Logger"/>
</otherwise>
</choice>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment