kepler.api.oauth module

The module contains the functionality related to OAuth2 integration.

kepler.api.oauth.add_user_to_session(request, user_id)

The function add the specified user as the authenticated user to the session.

kepler.api.oauth.oauth_authenticate(request)

The OAuth view handles the authentication of the user through OAuth API of JYU.

See https://dev-docs.app.jyu.fi/ for details.

Parameters:request – Pyramid request object.
Returns:Redirect to oauth_current_user_info or an error message if something went wrong.
kepler.api.oauth.oauth_current_user_info(request)

The view requests the user’s information from OAuth API of JYU and logging in the user to Kepler. If the user doesn’t already exist in Kepler, she/he will be added as a new user to the Kepler.

Parameters:request – Pyramid request object.
Returns:Redirect response to the home page of Kepler.
kepler.api.oauth.oauth_korppi_ical(request)

The view requests calendar data from Korppi in iCal format and returns it.

Parameters:request – Pyramid request object.
Returns:The calendar data in iCal format.