Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60721 articles
Browse latest View live

Viewing a list of users who are watching a category

$
0
0

Wes Osborn wrote:

We'd like a way to see which users have added a category to their watch list. Ideally this information would be able to be exposed to mods as well, or handled as a new security "type" for the category security settings.

Our use case is that we have mods that we assign to "check-in" with users to make sure that they are subscribing to a particular category and getting updates. Right now there is no real way that we can see to expose that information without going into each user account in admin and checking their preferences.

Posts: 5

Participants: 3

Read full topic


Official Single-Sign-On for Discourse

$
0
0

Sam Saffron wrote:

Discourse now ships with official hooks to perform auth offsite.

The Problem

Many sites wish to integrate with a Discourse site, however want to keep all user registration in a separate site. In such a setup all Login operations should be outsourced to a different site.

What if I would like SSO in conjunction with existing auth?

The intention around SSO is to replace Discourse authentication, if you would like to add a new provider see existing plugins such as: https://meta.discourse.org/t/vk-com-login-vkontakte/12987

Enabling SSO

To enable single sign on you have 3 settings you need to fill out:

enable_sso : must be enabled, global switch
sso_url: the offsite URL users will be sent to when attempting to log on
sso_secret: a secret string used to hash SSO payloads. Ensures payloads are authentic.

Once enable_sso is set to true:

  • Clicking on login or avatar will, redirect you to /session/sso which in turn will redirect users to sso_url with a signed payload.
  • Users will not be allowed to "change password". That field is removed from the user profile.
  • Users will no longer be able to use Discourse auth (username/password, google, etc)

What if you check it by mistake?

If you check enable_sso by mistake and need to revert to the original state and no longer have access to the admin panel

run:

RAILS_ENV=production bin/rails c
irb > SiteSetting.enable_sso = false

Implementing SSO on your site

Discourse will redirect clients to sso_url with a signed payload: (say sso_url is https://somesite.com/sso)

You will receive incoming traffic with the following

https://somesite.com/sso?sso=PAYLOAD&sig=SIG

The payload is a Base64 encoded string comprising of a nonce. The payload is always a valid querystring.

For example, if the nonce is ABCD. raw_payload will be:

nonce=ABCD, this raw payload is base 64 encoded.

The endpoint being called must

  1. Validate the signature, ensure that HMAC-SHA256 of sso_secret, PAYLOAD is equal to the sig
  2. Perform whatever authentication it has to
  3. Create a new payload with nonce, email, external_id and optionally (username, name, return_url)
  4. Base64 encode the payload
  5. Calculate a HMAC-SHA256 hash of the using sso_secret as the key and Base64 encoded payload as text
  6. Redirect back to http://discourse_site/session/sso_login?sso=payload&sig=sig

Discourse will validate that the nonce is valid (if valid it will expire it right away so it can no longer be used) it will attempt to:

  1. Log the user on by looking up an already associated external_id in the SingleSignOnRecord model
  2. Log the user on by using the email provided (updating external_id)
  3. Create a new account for the user providing (email, username, name) updating external_id

Security concerns

The nonce (one time token) will expire automatically after 10 minutes. This means that as soon as the user is redirected to your site they have 10 minutes to log in / create a new account.

The protocol is safe against replay attacks as nonce may only be used once.

Reference implementation

Discourse contains a reference implementation of the SSO class:

A trivial implementation would be:

class DiscourseSsoController < ApplicationController
  def sso
    secret = "MY_SECRET_STRING"
    sso = SingleSignOn.parse(request.query_string, secret)
    sso.email = "user@email.com"
    sso.name = "Bill Hicks"
    sso.username = "bill@hicks.com"
    sso.external_id = "123" # unique to your application
    sso.sso_secret = secret

    redirect_to sso.to_url("http://l.discourse/session/sso_login")
  end
end

Transitioning to and from single sign on.

The system always trusts emails provided by the single sign on endpoint. This means that if you had an existing account in the past on Discourse with SSO disabled, SSO will simply re-use it and avoid creating a new account.

If you ever turn off SSO, users will be able to reset passwords and gain access back to their accounts.

Real world example:

Given the following settings:

Discourse domain: http://discuss.example.com
SSO url : http://www.example.com/discourse/sso
SSO secret: d836444a9e4084d5b224a60c208dce14

User attempt to login

  • Nonce is generated: cb68251eefb5211e58c00ff1395f0c0b

  • Raw payload is generated: nonce=cb68251eefb5211e58c00ff1395f0c0b

  • Payload is Base64 encoded: bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI=\n

  • Payload is URL encoded: bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A

  • HMAC-SHA256 is generated on the encoded payload: 2828aa29899722b35a2f191d34ef9b3ce695e0e6eeec47deb46d588d70c7cb56

Finally browser is redirected to:

http://www.example.com/discourse/sso?sso=bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&sig=2828aa29899722b35a2f191d34ef9b3ce695e0e6eeec47deb46d588d70c7cb56

On the other end

  1. Payload is validated using HMAC-SHA256, if the sig mismatches, process aborts.
  2. By reversing the steps above nonce is extracted.

User logs in:

name: sam
external_id: hello123
email: test@test.com
username: samsam
  • Unsigned payload is generated:

nonce=cb68251eefb5211e58c00ff1395f0c0b&name=sam&username=samsam&email=test%40test.com&external_id=hello123

order does not matter, values are URL encoded

  • Payload is Base64 encoded

"bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGImbmFtZT1z\nYW0mdXNlcm5hbWU9c2Ftc2FtJmVtYWlsPXRlc3QlNDB0ZXN0LmNvbSZleHRl\ncm5hbF9pZD1oZWxsbzEyMw==\n

  • Payload is URL encoded

bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGImbmFtZT1z%0AYW0mdXNlcm5hbWU9c2Ftc2FtJmVtYWlsPXRlc3QlNDB0ZXN0LmNvbSZleHRl%0Acm5hbF9pZD1oZWxsbzEyMw%3D%3D%0A

  • Payload is signed

1c884222282f3feacd76802a9dd94e8bc8deba5d619b292bed75d63eb3152c0b

  • Browser redirects to:

http://discuss.example.com/session/sso_login?sso=bm9uY2U9Y2I2ODI1MWVlZmI1MjExZTU4YzAwZmYxMzk1ZjBjMGImbmFtZT1z%0AYW0mdXNlcm5hbWU9c2Ftc2FtJmVtYWlsPXRlc3QlNDB0ZXN0LmNvbSZleHRl%0Acm5hbF9pZD1oZWxsbzEyMw%3D%3D%0A&sig=1c884222282f3feacd76802a9dd94e8bc8deba5d619b292bed75d63eb3152c0b

Future work

  • We would like to gather more reference implementations for SSO on other platforms. If you have one please post to the Extensibility / SSO category.

  • Add session expiry and/or revalidation logic, so users are not logged in forever.

  • Create an API endpoint to log off users, in case somebody logs off the main site.

  • Consider adding a discourse_sso gem to make it easier to implement in Ruby.

Advanced Features

Updates:

2-Feb-2014

  • use HMAC-SHA256 instead of SHA256. This is more secure and cleanly separates key from payload.
  • removed return_url, the system will automatically redirect users back to the page they were on after login

4-April-2014

  • Added example

24-April-2014

  • Make note of custom user fields.

Posts: 41

Participants: 13

Read full topic

Usernames on top, lifting username length restrictions

$
0
0

Sam Saffron wrote:

I just deployed this change set:

It allows you to lift the max username length restriction.

For the time being I made this setting hidden, this means you need the following to raise it:

./launcher ssh app
rails c
SiteSetting.max_username_length = 40

Combined with this site customisation (thanks to @radq ) you can have usable site with long usernames:

@import "common/foundation/variables";

.topic-post {
  article > .row {
    & > .topic-meta-data {
      width: 79%;
      .contents {
        text-align: left;
        padding-left: 3%;
        position: relative;
      }
      .names {
        z-index: 1;
        position: absolute;
        top: -2px;
        left: 10%;
        width: 100%;
      }
      h3, .user-title {
        display: inline;
        padding-left: 5px;
        font-size: $base-font-size * 0.9;
        a {
            color: #6f6f6f;
            font-weight: bold;
        }
      }
    }
    & > .topic-body {
      width: 70.5%;
      margin-left: 7.5%;
      margin-top: -85px;
      border-top: none;
      padding-left: 10px;
      & > .contents {
        &.avoid-tab { padding-top: 0; }
        .topic-meta-data-inside, .avoid-tab .topic-meta-data-inside {
          margin-top: -52px;
        }
        .cooked, .avoid-tab .cooked {
          margin-top: 48px;
          z-index: 2;
        }
      }
    }
    & > .reply-to-tab {
      left: 9%;
      padding: 2px 12px;
      .avatar {
        height: 15px;
        width: 15px;
      }
    }
  }
  .embedded-posts {
    &.top {
      margin-left: 7.5%;
    }
    position: relative;
    .contents h5 {
      position: absolute;
      top: 12px;
      left: 95px;
      font-size: $base-font-size;
    }
    .topic-body {
      margin-top: 15px;
      .topic-meta-data-inside {
        margin-top: -15px;
      }
    }
  }
}

For example see: http://talk.folksy.com/t/welcome-to-the-discourse-forum-usability-test/62/93?u=sam

Posts: 17

Participants: 11

Read full topic

Limiting login to specific domains

$
0
0

Dror Deleon wrote:

Hi,

Im implementing Discourse as a Q&A platform for our company,

I would like to know if there is a way to limit Google login for certain domains. or to allow it for one domain only?

Thanks in advance,
Dror.

Posts: 3

Participants: 2

Read full topic

Optional blog-like “homepage” for the forum

$
0
0

Anton wrote:

I would like to use discourse for gaming community. We also need some page for recent news which will link to discussion in discource. It seems quite a waste to setup wordpress blog only for this purpose. Why not give some simplified blog functionality in discource.

Posts: 16

Participants: 13

Read full topic

How to use category color as background color?

$
0
0

probus wrote:

I want to change the background color of 'list-controls' (the one where category dropdown is in) div to match the category color. How can I do that?

Posts: 6

Participants: 3

Read full topic

Wrong French translation for the category page title

$
0
0

Camille Roux wrote:

Currently, category title in the French locale is "{title} Sujets" like in English, but it's not correct. It should something like "Sujets de la catégorie {title}".
I can't found the locale to change it. Anyone can help me?

Posts: 6

Participants: 4

Read full topic

Way to mute category for 3th users

$
0
0

Admir Hodzic wrote:

In my forum I have one very annoying category. That category (a.k. spam) should be muted for all users.
Since my users are low lever computer experienced also I did not yet done with translation of discourse.
Ill love to mute this category for them.
Is there way to I do MUTE-ing category for my users.

Or better will be to we add category parameter. Default: Watched | Tracked | Muted

Is there way to do some kind of for-each loops over users inside RAILS_ENV=development bundle exec rails console or whatever is that ( blush forgive me I am coming from .NET world)

Posts: 1

Participants: 1

Read full topic


Facebook Login App Problem? Please Help

$
0
0

Clever Moniker wrote:

So I searched and didn't find this yet...

I get this weird pop-up, does anyone know what it is? I'm new at this and a newb, so please be patient with me.

I'm hosting on discousehosting.com, don't know if that makes a difference.

Thanks for any help. smile

Posts: 4

Participants: 2

Read full topic

Next page button on admin / users list?

$
0
0

bryanlarsen wrote:

I'm trying to get the users list out of our forum to see if we get any conflicts if we turn on SSO.

We don't have many users, so I thought the easiest way to do this would be to cut and paste the HTML table from /admin/users/list into Google Docs. That works great for the first 100 users, but there doesn't seem to be a next page button. Is it supposed to be infinite scroll? If so it's broken for me.

I can probably do this by doing a select on the database directly, but the lack of a next page button does feel like a bug to me.

Posts: 1

Participants: 1

Read full topic

One unread private message notification that won't clear

$
0
0

Pugwash wrote:

I have one unread PM whereby the green notification will not clear. I tentatively categorised this as a bug but I'm not 100% sure? I have done a super refresh, read and replied to the post but the notification remains.

@zogstrip if you want to impersonate me to reproduce this please feel free.

Additional info:

Discourse version: 0.9.9

The post in question has been answered by an admin (me) and was automatically created when the user enrolled.

UPDATE:

It's cleared now, if it happens again I'll see if there is any specific pattern that triggers it.

Posts: 5

Participants: 3

Read full topic

Muted and non-emailed category for reference material

$
0
0

Andrew Lombardi wrote:

Been trying to find this via the admin but appears unable.

In our group we share books we've read, hotspots we've visited, but those things would make the board quite noisy if they were all posted and shown as unread individually as people throw their books up. First thought is to have a Category that is automatically muted for all users so it can be referenced later, but it won't email out when topics get added to it, and it won't show up in the Unread section.

Not really sure how exactly to solve this yet. Is there a way to do this with Discourse?

Thanks!

Posts: 1

Participants: 1

Read full topic

Make search options optional

$
0
0

TechnoBear wrote:

Entering search from a Profile page (mine or another member's) the search facility automatically prefers posts by that member. Likewise from within a category.

Both those things are useful as an option, but frequently they're not what I want, and it's irritating to have to return to the home page to get an "unbiased" search.

Is there any way for the user to take control of search preferences, rather than Discourse?

Posts: 1

Participants: 1

Read full topic

Sending PM requires first locating recipient

$
0
0

TechnoBear wrote:

On vBulletin, I can send a PM to somebody by going to my messages and typing a username into a new message. Unless I'm missing something, that's not possible on Discourse. Instead, you need to visit the member's Profile page or use the pop-up box from their avatar on a post.

Not very convenient.

Is there any way this can be improved?

Posts: 1

Participants: 1

Read full topic

Configuring Facebook login for Discourse

$
0
0

Jeff Atwood wrote:

  1. Go to developers.facebook.com and create an app:

  2. Once the app is created, click on Settings on the left. Enter forum.example.com in the App Domains field.

  3. Then click Add Platform, choose Website, and enter http://forum.example.com in the Site URL field.

  4. Enter your email in the Contact Email field

  5. Under the Advanced tab (at the top), make sure Client OAuth Login is enabled. Enter http://forum.example.com/auth/facebook/callback in the Valid OAuth redirect URIs field.

  6. Click the Save Changes button.

  7. The App ID and App Secret go in the facebook_app_id and facebook_app_secret settings in the users section.

  8. Go to Status & Review and change "available to the general public" to Yes.

Basic settings

Advanced settings

Status & Review

Posts: 4

Participants: 4

Read full topic


Backup process broken

$
0
0

Paul Apostolos wrote:

I had automatic backups setup to go to S3 and they stopped working.

The backups tab Backup button now says "Cancel". If I click cancel, it changes to the blue backup button then if I navigate to the page I get the same Cancel button.

If I try to click the Backup button (after clicking Cancel) I get this message

I figured it had to be something with S3 so I removed all that and did a ./launcher rebuild app (three times now) and still the same problem.

Sidekiq shows the job in the scheduler still despite automatic backups being turned off in the settings.

We're supposed to go live today and I need to get a backup pulled first. Please help.

Posts: 5

Participants: 2

Read full topic

RSS Item guid changed when the item title is updated

$
0
0

Camille Roux wrote:

Currently, the guid is the URL of the item. But when the title is updated, the url changed too.
So, if you use a service like Twitterfeed, your discussion we'll be post twice.

PS : Moreover, for this use, it should be better to sort them by creation date instead of update date.

Posts: 11

Participants: 4

Read full topic

How to handle multiple account?

$
0
0

Ahmad Suhendri wrote:

On some big forums, some users have multiple accounts to support their own opinion, get an extra like, get an extra vote on polling or post offensive to other users.

How can we use discourse to handle issue like this?

Posts: 3

Participants: 3

Read full topic

Reply with edit becomes cluttered

Can't access Ruby console in Docker install

$
0
0

Paul Apostolos wrote:

I imported a backup and now I need to activate the admin user again.

I tried to access the Ruby console using RAILS_ENV=production bundle exec rails c from within the Docker container and I get FATAL: role "root" does not exist (PG::Error)

I'm not sure what is going wrong.

Posts: 1

Participants: 1

Read full topic

Viewing all 60721 articles
Browse latest View live




Latest Images