mojang.api.auth.models¶
- class mojang.api.auth.models.AuthenticatedUser(access_token: str, refresh_token: str)¶
Bases:
ABC
Base class for every authenticated user
- Parameters:
- Variables:
name (str) – The user name
uuid (str) – The user uuid
is_legacy (bool) – Wether the account has migrated
is_demo (bool) – Wether the account is demo
skin (Skin) – The active user skin
cape (Cape) – The active user cape
name_change_allowed (bool) – Can the user change name
created_at (datetime.datetime) – When was the user created
- change_name(name: str)¶
Change user name. For more details checkout
change_user_name()
- Parameters:
name (str) – The new name
- change_skin(path: str, variant: str | None = 'classic')¶
Change user skin. For more details checkout
change_user_skin()
- abstract close()¶
- property created_at: datetime.datetime | None¶
- hide_cape()¶
Hide user cape. For more details checkout
hide_user_cape()
- abstract refresh()¶
- reset_skin()¶
Reset user skin. For more details checkout
reset_user_skin()
- class mojang.api.auth.models.MicrosoftAuthenticatedUser(access_token: str, refresh_token: str, oauth_client: msal.ClientApplication)¶
Bases:
AuthenticatedUser
Class for user with a Microsoft account
- close()¶
Close current session
- refresh()¶
Refresh current session
- class mojang.api.auth.models.MojangAuthenticationApp(client: msal.ClientApplication, redirect_uri: str)¶
Bases:
object
- get_session(code: str) MicrosoftAuthenticatedUser ¶