MCPcopy Create free account
hub / github.com/EasyIME/PIME / authenticate_redirect

Method authenticate_redirect

python/python3/tornado/auth.py:88–114  ·  view source on GitHub ↗

Redirects to the authentication URL for this service. After authentication, the service will redirect back to the given callback URI with additional parameters including ``openid.mode``. We request the given attributes for the authenticated user by default (name, em

(
        self,
        callback_uri: Optional[str] = None,
        ax_attrs: List[str] = ["name", "email", "language", "username"],
    )

Source from the content-addressed store, hash-verified

86 """
87
88 def authenticate_redirect(
89 self,
90 callback_uri: Optional[str] = None,
91 ax_attrs: List[str] = ["name", "email", "language", "username"],
92 ) -> None:
93 """Redirects to the authentication URL for this service.
94
95 After authentication, the service will redirect back to the given
96 callback URI with additional parameters including ``openid.mode``.
97
98 We request the given attributes for the authenticated user by
99 default (name, email, language, and username). If you don't need
100 all those attributes for your app, you can request fewer with
101 the ax_attrs keyword argument.
102
103 .. versionchanged:: 6.0
104
105 The ``callback`` argument was removed and this method no
106 longer returns an awaitable object. It is now an ordinary
107 synchronous function.
108 """
109 handler = cast(RequestHandler, self)
110 callback_uri = callback_uri or handler.request.uri
111 assert callback_uri is not None
112 args = self._openid_args(callback_uri, ax_attrs=ax_attrs)
113 endpoint = self._OPENID_ENDPOINT # type: ignore
114 handler.redirect(endpoint + "?" + urllib.parse.urlencode(args))
115
116 async def get_authenticated_user(
117 self, http_client: Optional[httpclient.AsyncHTTPClient] = None

Callers 2

getMethod · 0.45
getMethod · 0.45

Calls 2

_openid_argsMethod · 0.95
redirectMethod · 0.80

Tested by 2

getMethod · 0.36
getMethod · 0.36