Topic on Project:Support desk

How to authenticate a user by my own Authentication server?

10
Lsherwinforone (talkcontribs)

If I want to build local wiki by mediawiki, and authenticate a user by my own Authentication server. What should I do? Did I have to write an Extension such like Extension:GoogleLogin? It's so complicated.

@Florianschmidtwelzow@Anomie

Anomie (talkcontribs)

If your own authentication server is LDAP-based, you might be able to use Extension:LdapAuthentication. There might be extensions for other types of authentication servers too.

Lsherwinforone (talkcontribs)

It's OAuth2.0 base.Is Extension:OATHAuth the right one I should choose? I assume oauth extensions let wiki user to login other website/client.what I need to do quite the contrary.

@Florianschmidtwelzow

Anomie (talkcontribs)

OATHAuth is for two-factor OATH authentication, not OAuth. You might look at Extension:OAuthAuthentication; that extension seems to be specific to authenticating against another MediaWiki wiki using Extension:OAuth, but might be a starting point.

Lsherwinforone (talkcontribs)

Can I use API login by PHP? I try to autologin and create new account by php, but things have not gone smoothly.

1)get token by post:api.php?action=query&format=json&meta=tokens&type=login

2)then post: api.php?action=login&lgname=USERNAME&lgpassword=PASSWORD&lgtoken=TOKEN(get from step1)

but ["result"]=> string(9) "NeedToken"

Because in api/ApiLogin.php $token->wasNew() ==true, I not sure what's wrong. To simulate this process I post same request url in POSTMAN , got "result": "Success".

then I try to use clientlogin by PHP, result: "authmanager-authn-no-primary"

@Florianschmidtwelzow@Anomie

Anomie (talkcontribs)

If you're getting "NeedToken" like that, it probably means you're not handling cookies properly.

I'm not seeing how logging into MediaWiki via the API relates to your question about using your own authentication server to log into MediaWiki, though.

Lsherwinforone (talkcontribs)

in includes/session/Token.php

$timestamp = self::getTimestamp( $userToken );

Turns out $timestamp is NULL, what's it means?

Lsherwinforone (talkcontribs)

I try to  integrate mediawiki to a Tools Manager website which already have it's own user system. I guess the workflow could be:

1)Authenticate from Tools Manager website, got username,password,accessToken.

2)check username already in wiki database or not.

3)new user,using CreateAccount api.

4)otherwise,using Login api.

Both Tools Manager website and mediawiki build on my own server.

Florianschmidtwelzow (talkcontribs)

Hi,

I think the most important question is: What do you mean with "own authentication server". What technology is it based on, what API does it provide? Like @Anomie already mentioned, there're already a lot of extensions, which provide authentication methods for MediaWiki, so your server may already be supported :)

Best,

Florian

This post was hidden by Malyacko (history)