Skip to content

Commit 61bd6c9

Browse files
authored
Merge pull request #44 from spinen/feature/allowSubdomain
Allow setting an optional subdomain
2 parents 22a184f + b8aacb3 commit 61bd6c9

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

readme.md

+20-17
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,24 @@ All of the configuration values are stored in under a `discourse` key in `config
4040
'discourse' => [
4141
// Middleware for the SSO login route to use
4242
'middleware' => ['web', 'auth'],
43-
43+
4444
// The route's URI that acts as the entry point for Discourse to start the SSO process.
4545
// Used by Discourse to route incoming logins.
4646
'route' => 'discourse/sso',
47-
47+
48+
// Optional domain to link sso route when using SSubdomain Routing
49+
'domain' => null,
50+
4851
// Secret string used to encrypt/decrypt SSO information,
4952
// be sure that it is 10 chars or longer
5053
'secret' => env('DISCOURSE_SECRET'),
51-
54+
5255
// Disable Discourse from sending welcome message
5356
'suppress_welcome_message' => 'true',
54-
57+
5558
// Where the Discourse forum lives
5659
'url' => env('DISCOURSE_URL'),
57-
60+
5861
// Api-specific items
5962
// For logging out of Discourse directly, generate an API key as an "All user key" and put the key & user here.
6063
// @see https://meta.discourse.org/t/how-to-create-an-api-key-on-the-admin-panel/87383
@@ -68,7 +71,7 @@ All of the configuration values are stored in under a `discourse` key in `config
6871
'user' => [
6972
// Check to see if the user has forum access & should be logged in via SSO
7073
'access' => null,
71-
74+
7275
// Discourse Groups to make sure that the user is part of in a comma-separated string
7376
// NOTE: Groups cannot have spaces in their names & must already exist in Discourse
7477
'add_groups' => null,
@@ -78,23 +81,23 @@ All of the configuration values are stored in under a `discourse` key in `config
7881

7982
// Full path to user's avatar image
8083
'avatar_url' => null,
81-
84+
8285
// The avatar is cached, so this triggers an update
8386
'avatar_force_update' => false,
84-
87+
8588
// Content of the user's bio
8689
'bio' => null,
87-
90+
8891
// Verified email address (see "require_activation" if not verified)
8992
'email' => 'email',
90-
93+
9194
// Unique string for the user that will never change
9295
'external_id' => 'id',
93-
94-
// Boolean for making user a Discourse moderator. Leave null to ignore
96+
97+
// Boolean for making user a Discourse moderator. Leave null to ignore
9598
'moderator' => null,
96-
97-
// Full name on Discourse if the user is new or
99+
100+
// Full name on Discourse if the user is new or
98101
// if SiteSetting.sso_overrides_name is set
99102
'name' => 'name',
100103

@@ -103,11 +106,11 @@ All of the configuration values are stored in under a `discourse` key in `config
103106
// There is not a way to specify the exact list of groups that a user is in, so
104107
// you may want to send the inverse of the 'add_groups'
105108
'remove_groups' => null,
106-
109+
107110
// If the email has not been verified, set this to true
108111
'require_activation' => false,
109-
110-
// username on Discourse if the user is new or
112+
113+
// username on Discourse if the user is new or
111114
// if SiteSetting.sso_overrides_username is set
112115
'username' => 'email',
113116
],

src/SsoServiceProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ function (Router $router) {
2525
$router->get(
2626
$this->app['config']->get('services.discourse.route'),
2727
[
28-
'uses' => 'Spinen\Discourse\Controllers\SsoController@login',
2928
'as' => 'sso.login',
29+
'domain' => $this->app['config']->get('services.discourse.domain', null),
30+
'uses' => 'Spinen\Discourse\Controllers\SsoController@login',
3031
]
3132
);
3233
}

0 commit comments

Comments
 (0)