org.apache.camel.example.gauth
Class TutorialController
java.lang.Object
org.apache.camel.example.gauth.TutorialController
@Controller
@RequestMapping(value="/calendar")
public class TutorialController
- extends Object
Single controller for the demo application that handles GET requests. Obtains OAuth access
token and access token secret from cookies and uses them to obtain calendar names from the
Google Calendar API. If the interaction with the calendar API fails due to invalid or non-
existing OAuth tokens an error message is displayed in authorize.jsp. If it succeeds the
calendar names are displayed in calendar.jsp.
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 |
String |
handleGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.ModelMap model)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TutorialController
public TutorialController()
handleGet
@RequestMapping(method=GET)
public String handleGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.ModelMap model)
throws Exception
- Throws:
Exception
Apache CAMEL