basic
BaseBasicAuthConfig
from dara.core.auth.basic import BaseBasicAuthConfig
class BaseBasicAuthConfig(BaseAuthConfig)
Definition of a Base Basic Auth Config that extends the generic Auth Config. Allows for a dict of users to be specified and checked against when requesting auth
Attributes
- component_config: ClassVar[AuthComponentConfig]
- users: Dict[str, str]
Methods
get_token
def get_token(body: SessionRequestBody) -> TokenResponse
Get a new session token.
Verifies the username and password against the users dict, and returns a new token if valid.
Arguments:
body
: the request body
verify_token
def verify_token(token: Any) -> TokenData
Verifies the decoded jwt token.
Arguments:
token
: the decoded jwt token
BasicAuthConfig
from dara.core.auth.basic import BasicAuthConfig
class BasicAuthConfig(BaseBasicAuthConfig)
Authenticate the dashboard with a single user
MultiBasicAuthConfig
from dara.core.auth.basic import MultiBasicAuthConfig
class MultiBasicAuthConfig(BaseBasicAuthConfig)
Authenticate the dashboard with multiple users
DefaultAuthConfig
from dara.core.auth.basic import DefaultAuthConfig
class DefaultAuthConfig(BaseAuthConfig)
Default no-auth auth config, useful for local development
Attributes
- component_config: ClassVar[AuthComponentConfig]
Methods
get_token
def get_token(_: SessionRequestBody) -> TokenResponse
Get a session token.
In default auth a new token is returned every time.
verify_token
def verify_token(token: str) -> TokenData
Verify the session token.
In default auth, the token is just decoded and returned.
Arguments:
token
: the token to verify