The username of the user
The password of the user
Optional
config: GetTokenConfigThe config for the function
The server to get the token from
The origin to use for the API calls, aka the "domain" of the web app (only needed for CORS)
The options to pass to axios. Please use sparingly as this may be considered a hack. Please open an issue if you need this.
The axios instance to use. This is mainly intended for CORS circumvention purposes. Use, for example, axios-over-http to do the actual requests on a server.
An object containing the token and the cookie
Use this function to retrieve tokens by using a username and password.
If you are using this function in a browser environment, you need to specify the origin. If you try to access a Wikimedia server, you need to be on a Wikimedia domain. All other domains are blocked. See https://phabricator.wikimedia.org/T22814 and https://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php#:~:text=%24wgCrossSiteAJAXdomains
You can pass in a custom axios instance to use for the requests. This is mainly intended for CORS circumvention purposes. Use, for example, axios-over-http to do the actual requests on a server. The only requirement for these axios instances is that they have the same API as the axios package. The only required function is the main axios() function.