Jump to content
  • 0

How can I get the mediawiki's ConsumerKey?


gaon12

Question

1 answer to this question

Recommended Posts

  • 1

Extension:OAuth sets up the OAuth server. In other words, it lets other applications connect to you. Depending on what you want for your OAuth deployment, you'll want one of two things:

  1. If you want your wiki to be the canonical source of users, install Extension:OAuth. From there, you can register consumer applications on your wiki to obtain consumer keys and secret keys for use elsewhere to connect to your wiki. (More on this process further below)
  2. If you want your wiki to connect to some other wiki or OAuth source, install Extension:OAuthAuthentication. I'm not sure if this extension has been updated yet to work well with most recent versions of MediaWiki, so you may experience some issues when using it. Please note that the OAuthAuthentication extension is written to support logging in via other wikis running Extension:OAuth. I do not believe it supports being a generic OAuth client (for example, to auth against Google or GitHub), but I could be wrong as I've never personally tried it.

To locate your consumer key and secret key, go to the wiki with Extension:OAuth installed (this will be your wiki in case 1, or the other wiki in case 2), and browse to the page [[Special:OAuthConsumerRegistration]]. It will be listed as "OAuth Consumer Registration" under the "Users and Rights" heading in the special pages list. From there, follow these steps:

  1. Click "Request a token for a new consumer"
  2. Fill out the request form as per this image:
    image.thumb.png.5c7506ad95dedcb98ec23b4816f462a3.png
  3. Click "Propose consumer." You will be given your Consumer Token and Secret Token. Write down your Secret Token now, you will not be able to view it after leaving this page.
    image.thumb.png.74e0c0ec7820733b0a3903b5ceb115f7.png
  4. Before the consumer can be used, it must be approved. If you are authenticating against a wiki you do not control, follow the approval process there. If you do control the wiki with Extension:OAuth installed, browse to [[Special:OAuthManageConsumers/proposed]]. If you get a permission denied error, ensure that you have given yourself the mwoauthmanageconsumer permission via $wgGroupPermissions in LocalSettings.php:
    $wgGroupPermissions['sysop']['mwoauthmanageconsumer'] = true;

     

  5. Once approved, you need to add some configuration in LocalSettings.php to the wiki with Extension:OAuthAuthentication installed:
     

    $wgOAuthAuthenticationUrl = 'https://otherwiki.com/w/index.php?title=Special:OAuth'; // This assumes that otherwiki.com is where Extension:OAuth is installed. Change as necessary
    $wgOAuthAuthenticationConsumerKey = 'bf0252aa9e521f1463a0ba171ba20367'; // Consumer Token
    $wgOAuthAuthenticationConsumerSecret = '248f75d271d9fa34ea7d9da2264c0cb1400a54e5'; // Secret Token
    // Insert other configuration defined by Extension:OAuthAuthentication if needed. Check its extension page on mediawiki.org for more details.


     

If you are not using Extension:OAuthAuthentication (in other words, you're setting up an OAuth server so that non-MediaWiki clients can log in using wiki credentials), then you will need to configure those clients as step 5 instead of adding things to LocalSettings.php. The Callback URL in your registration in step 2 should also be modified to be appropriate for that external client.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.