def CalendarTokenRequestUrl(redirect_path): """Constructs a calendar token request url. Args: redirect_path: The url that should be called back with the auth token. Returns: A string url that can be used to redirect the user to provide auth tokens to calendar. """ scopes = service.lookup_scopes('cl') domain = os.environ['AUTH_DOMAIN'] if domain.lower() == 'gmail.com': domain = 'default' token_request_url = auth.generate_auth_sub_url( redirect_path, scopes, secure=False, session=True, domain=domain ) return token_request_url
def __init__(self, next_url, scopes, domain='default'): url = str(generate_auth_sub_url(next_url, scopes, domain=domain)) super(AuthSubURLRedirect, self).__init__(url)