Abstract Base Class for other web frameworks’ API¶
It is here only for reference, so that subclasses can be documented properly. It is an abstract base class. You cannot use it directly.
- class identity.web.WebFrameworkAuth(client_id: str, *, client_credential=None, oidc_authority: str | None = None, authority: str | None = None, redirect_uri: str | None = None, b2c_tenant_name: str | None = None, b2c_signup_signin_user_flow: str | None = None, b2c_edit_profile_user_flow: str | None = None, b2c_reset_password_user_flow: str | None = None)¶
This is a mid-level helper to be subclassed. Do not use it directly.
- __init__(client_id: str, *, client_credential=None, oidc_authority: str | None = None, authority: str | None = None, redirect_uri: str | None = None, b2c_tenant_name: str | None = None, b2c_signup_signin_user_flow: str | None = None, b2c_edit_profile_user_flow: str | None = None, b2c_reset_password_user_flow: str | None = None)¶
Create an identity helper for a web application.
- Parameters:
client_id¶ (str) – The client_id of your web application, issued by its authority.
client_credential¶ (str) – It is somtimes a string. The actual format is decided by the underlying auth library. TBD.
oidc_authority¶ (str) – The authority which your app registers with your OpenID Connect provider. For example,
https://example.com/foo. This library will concatenate/.well-known/openid-configurationto form the metadata endpoint.authority¶ (str) – The authority which your app registers with your Microsoft Entra ID. For example,
https://example.com/foo. Historically, the underlying library will sometimes automatically append “/v2.0” to it. If you do not want that behavior, you may useoidc_authorityinstead.redirect_uri¶ (str) –
This will be used to mount your project’s auth views accordingly.
For example, if your input here is
https://example.com/x/y/z/redirect, then your project’s redirect page will be mounted at “/x/y/z/redirect”, login page will be at “/x/y/z/login”, and logout page will be at “/x/y/z/logout”.b2c_tenant_name¶ (str) – The tenant name of your Microsoft Entra ID tenant, such as “contoso”. Required if your project is using Microsoft Entra ID B2C.
b2c_signup_signin_user_flow¶ (str) – The name of your Microsoft Entra ID tenant’s sign-in flow, such as “B2C_1_signupsignin1”. Required if your project is using Microsoft Entra ID B2C.
b2c_edit_profile_user_flow¶ (str) – The name of your Microsoft Entra ID tenant’s edit-profile flow, such as “B2C_1_profile_editing”. Optional.
b2c_edit_profile_user_flow¶ – The name of your Microsoft Entra ID tenant’s reset-password flow, such as “B2C_1_reset_password”. Optional.
- get_edit_profile_url()¶
A helper to get the URL for Microsoft Entra B2C’s edit profile page.
You can pass this URL to your template and render it there.
- class identity.pallet.PalletAuth(app, *args, prompt: str | None = None, **kwargs)¶
A common base class for Flask and Quart web authentication.
Provides shared functionality for login handling, session management, and routing used by both Flask and Quart framework implementations.
- __init__(app, *args, prompt: str | None = None, **kwargs)¶
Initialize the Auth class for a Pallet-based web application.
- Parameters:
app¶ – The Flask or Quart application instance, or
None. If None, you must call init_app() later. This pattern can be useful when your project does not use a global app object, such as when using the application factory pattern.prompt¶ (str) –
Optional. The prompt parameter to be used during login. Valid values are defined in OpenID Connect Core spec.
Starting from Identity 0.11.0, the default value is changed from
"select_account"toNone.Nonemeans no prompt will be sent in the authentication request, not even string"none". The Identity Server will decide whether to prompt.
- get_edit_profile_url()¶
A helper to get the URL for Microsoft Entra B2C’s edit profile page.
You can pass this URL to your template and render it there.
- init_app(app)¶
Initialize the auth helper with your app instance.