# Discourse

[![]( "Hex")](
[![Build Status](](
[![Coverage Status](](
[![]( "License")](LICENSE)

Simple Discourse library including SSO support.

## Installation

The package can be installed
by adding `discourse` to your list of dependencies in `mix.exs`:

def deps do
    {:discourse, "~> 0.0.1"}

The docs can be found at [](

## Quick Start

Configure `:discourse`:
config :discourse,
  url: "",
  secret: "d836444a9e4084d5b224a60c208dce14"

### SSO

Handle login request: (based on Phoenix)
defmodule MyAppWeb.UserController do
  use MyAppWeb, :controller
  alias Discourse.SSO

  def login(conn, %{"sso" => sso, "sig" => sig}) do
    {:ok, nonce} = SSO.validate(sso, sig)

    # User login
    user = get_session(conn, :user)

    redirect(conn, external: SSO.sign_url(,, nonce))

## Copyright and License

Copyright (c) 2018, SQUARE ENIX LTD.

Discourse code is licensed under the [MIT License](LICENSE).