org.apache.camel.example.gauth
Class TutorialTokenProcessor
java.lang.Object
org.apache.camel.example.gauth.TutorialTokenProcessor
- All Implemented Interfaces:
- org.apache.camel.Processor
public class TutorialTokenProcessor
- extends Object
- implements org.apache.camel.Processor
Reads an OAuth access token plus access token secret from a Camel message and stores them in
cookies. These cookies are needed by TutorialController
for accessing a user's calendar via the Google Calendar API. The cookies are valid for one
hour. Finally, it generates an HTTP 302 response that redirects the user to the application's
main location (/oauth/calendar).
In production systems it is not recommended to store access tokens in cookies. The
recommended approach is to store them in a database. The demo application is only doing that
to keep the example as simple as possible. However, an attacker could not use an access token
alone to get access to a user's calendar data because the application's consumer secret is
necessary for that as well. The consumer secret never leaves the demo application.
|
Method Summary |
void |
process(org.apache.camel.Exchange exchange)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TutorialTokenProcessor
public TutorialTokenProcessor()
process
public void process(org.apache.camel.Exchange exchange)
throws Exception
- Specified by:
process in interface org.apache.camel.Processor
- Throws:
Exception
Apache CAMEL