providers/wikimedia
default()β
default<
P
>(options
):OAuthConfig
<P
>
Add Wikimedia login to your page.
Setupβ
Callback URLβ
https://example.com/api/auth/callback/wikimedia
Configurationβ
import Auth from "@auth/core"
import Wikimedia from "@auth/core/providers/wikimedia"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Wikimedia({
clientId: WIKIMEDIA_CLIENT_ID,
clientSecret: WIKIMEDIA_CLIENT_SECRET
})
]
})
Resourcesβ
Configuration stepsβ
- Go to and accept the Consumer Registration doc: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration
- Request a new OAuth 2.0 consumer to get the
clientId
andclientSecret
: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose/oauth2- Add the following redirect URL into the console:
http://<your-next-app-url>/api/auth/callback/wikimedia
- Do not check the box next to This consumer is only for your username
- Unless you explicitly need a larger scope, feel free to select the radio button labelled User identity verification only - no ability to read pages or act on the users behalf.
- Add the following redirect URL into the console:
After registration, you can initially test your application only with your own Wikimedia account. You may have to wait several days for the application to be approved for it to be used by everyone.
Notesβ
This provider also supports all Wikimedia projects:
- Wikipedia
- Wikidata
- Wikibooks
- Wiktionary
- etc..
Please be aware that Wikimedia accounts do not have to have an associated email address. So you may want to add check if the user has an email address before allowing them to login.
By default, Auth.js assumes that the Wikimedia provider is based on the OAuth 2 specification.
The Wikimedia provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Type parametersβ
Parameter |
---|
P extends WikimediaProfile < P > |
Parametersβ
Parameter | Type |
---|---|
options | OAuthUserConfig < P > |
Returnsβ
OAuthConfig
< P
>