def _get_endpoint(self, endpoint_key, **kwargs): """ Returns the OIDC endpoint with the given key found in the OIDC discovery document, with the given kwargs added as query parameters. Additionally, any defined parameters found in the OIDC configuration block are also added. """ endpoint = self._oidc_config().get(endpoint_key, "") if not endpoint: return None (scheme, netloc, path, query, fragment) = urlparse.urlsplit(endpoint) # Add the query parameters from the kwargs and the config. custom_parameters = self.config.get("OIDC_ENDPOINT_CUSTOM_PARAMS", {}).get(endpoint_key, {}) query_params = urlparse.parse_qs(query, keep_blank_values=True) query_params.update(kwargs) query_params.update(custom_parameters) return OAuthEndpoint( urlparse.urlunsplit((scheme, netloc, path, {}, fragment)), query_params)
def token_endpoint(self): return OAuthEndpoint(slash_join(self._endpoint(), '/oauth/token'))
def authorize_endpoint(self): return OAuthEndpoint(slash_join(self._endpoint(), '/oauth/authorize'))
def user_endpoint(self): return OAuthEndpoint(slash_join(self._api_endpoint(), 'user'))
def token_endpoint(self): return OAuthEndpoint( slash_join(self._endpoint(), '/login/oauth/access_token'))
def user_endpoint(self): return OAuthEndpoint("https://www.googleapis.com/oauth2/v1/userinfo")
def token_endpoint(self): return OAuthEndpoint("https://accounts.google.com/o/oauth2/token")
def authorize_endpoint(self): return OAuthEndpoint("https://accounts.google.com/o/oauth2/auth", params=dict(response_type="code"))
def authorize_endpoint(self): return OAuthEndpoint( slash_join(self._endpoint(), "/login/oauth/authorize"))