Official support for Microsoft Azure AD?

(Craig Gambino) #1

Hi everyone,

I am looking for information on if Azure AD is supported through an Official plugin. We have been attempting to use the OAuth2_Basic plugin, and it’s connecting and coming back, but we get an “unauthorized” user.

I’m wondering if anyone has sample settings for the OAuth2_Basic plugin to work with Azure AD, or if there is another official plugin and the settings for that as well.

Thanks for the help!

(Rafael dos Santos Silva) #2

We do have GitHub - discourse/discourse-azure-ad

(Craig Gambino) #3

Is this an Official Plugin? Installing it exploded with this error:

I, [2018-08-13T18:40:35.703008 #13]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
rake aborted!
NoMethodError: undefined method `azure_client_id' for GlobalSetting:Class

I, [2018-08-13T18:40:56.543410 #13]  INFO -- : Terminating async processes
I, [2018-08-13T18:40:56.543611 #13]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 68
I, [2018-08-13T18:40:56.543885 #13]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 184
2018-08-13 18:40:56.544 UTC [68] LOG:  received fast shutdown request
184:signal-handler (1534185656) Received SIGTERM scheduling shutdown...
2018-08-13 18:40:56.547 UTC [68] LOG:  aborting any active transactions
2018-08-13 18:40:56.549 UTC [68] LOG:  worker process: logical replication launcher (PID 77) exited with exit code 1
2018-08-13 18:40:56.552 UTC [72] LOG:  shutting down
2018-08-13 18:40:56.569 UTC [68] LOG:  database system is shut down
184:M 13 Aug 18:40:56.642 # User requested shutdown...
184:M 13 Aug 18:40:56.642 * Saving the final RDB snapshot before exiting.
184:M 13 Aug 18:40:56.657 * DB saved on disk
184:M 13 Aug 18:40:56.657 # Redis is now ready to exit, bye bye...

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 388 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development --retry 3 --jobs 4'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
[root@ip-10-20-40-33 discourse]#

(Rafael dos Santos Silva) #4

Did you follow the README instructions? Adding the ENV variables, etc ?

(Sam Saffron) #5

Yeah you are missing an env var for DISCOURSE_AZURE_CLIENT_ID we should clean the failure mode up here.

(Craig Gambino) #6

Thanks to you both, completely missed that and misunderstood the instructions. Made these changes and it worked.