Code Monkey home page Code Monkey logo

discourse-battlenet-auth's Introduction

discourse-battlenet-auth

This plugin is an OmniAuth login provider allowing Battle.net login to Discourse. This plugin utilizes omniauth-bnet.

Note: I do not know Ruby/RoR and this is my very first dabbling with such. Things have surely been done poorly and I apologize for that ahead of time.

Features

  • Allow users to signup/login to Discourse via their Battle.net Account
  • Sets their username as their Battletag (# is replaced with _)
  • Allows editing of imported info before account creation
  • Customizable button text

Requirements

  1. A working Discourse installation through Docker [reference]
  2. (optional) SSL

Installation and Setup

Installing the Plugin in Discourse

Install the plugin by editing your app.yml file:

$ cd /var/discourse && sudo vim containers/app.yml

Add the following line to the hooks:
Note: spacing is no joke in YAML, be precise!

- git clone https://github.com/coryjreid/discourse-battlenet-auth.git

It should look like this:

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/coryjreid/discourse-battlenet-auth.git

Now run:

$ sudo ./launcher rebuild app

You need an application with Battle.net to allow authentication. If you don't have one yet you can easily register a new application at the Battle.net Developer Portal. I suggest doing this while Discourse rebuilds.

Creating a Battle.net Application

  1. Navigate to Applications > Create A New Application
  2. Fill in the info as you see fit
  3. Add the following to REGISTER CALLBACK URL
    https://YOUR.DISCOURSE.COM/auth/bnet/callback
    Note: Use http or https depending on what your site supports
  4. Check ISSUE A NEW GAME KEY FOR GAME APIS
  5. BASIC PLAN should be selected by default
  6. Agree to the Terms and click Register Application
  7. Copy down the Key and Secret as you will need them shortly.

Configuring the Plugin

Assuming your Discourse has finished rebuilding and is online, login and access the admin control panel, navigate to Settings > Login, and scroll down to find your Battle.net settings (tip: filter using battlenet in the search box).

  1. Check the box to enable login with Battle.net
  2. Copy and paste your Application Key into the appropriate field
  3. Copy and paste your Application Secret into the appropriate field
  4. Logout to see your plugin in action!

Getting Plugin Updates

Simply rebuild your Discourse instance!

$ cd /var/discourse && sudo ./launcher rebuild app

Contributing / Helping

  • Create a Pull Request with a new translation
  • Log Issues
  • Submit Pull Requests to help resolve issues or add new features

License

MIT

discourse-battlenet-auth's People

Contributors

coryjreid avatar

Stargazers

Gavin Coyne avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.