Authnetication
MqAuth
dataclass
MqAuth(
client_id: str,
client_secret: str,
client: Client = (lambda: Client())(),
env: MqApiEnvironment = PROD,
expires_at: datetime = (lambda: now())(),
)
Methods:
-
refresh–Refresh the acccess token
Attributes:
-
client(Client) – -
client_id(str) – -
client_secret(str) – -
env(MqApiEnvironment) – -
env_str(str) – -
expires_at(datetime) – -
oauth_host(str) – -
token(str) –Returns the token. If expired, will automatically renew.
-
token_url(str) –
client
class-attribute
instance-attribute
client: Client = field(
default_factory=lambda: Client(), repr=False
)
expires_at
class-attribute
instance-attribute
token
property
token: str
Returns the token. If expired, will automatically renew.
Raises:
-
AuthenticationException–if the authentication fails
Returns:
-
str(str) –the Bearer token, without
Bearerprefix
refresh
refresh() -> None
Refresh the acccess token
MqApiEnvironment
See also: Data models for base types.