Adding OKTA Single Sign-on Support - #568
forescout-spollock wants to merge 2 commits into
Conversation
|
There are some changes with sign-up and auto-login that we have not solved and could use your help. |
|
You should never manually modify files in the vendor folder. All files in there come through composer and are maintained by their creator. These changes will get lost with every update of the dependecies. The vendor-folder is excluded from the repo since it can be recreated identically on every system thanks to composer. To use okta with bookstack there should be used a package that extends socialite like e.g. https://github.com/tequilarapido/socialite-okta (just googled, i have no experience with this package) |
|
@ssddanbrown - Any info on this - I know we would love this merged into the main code branch. |
|
@forescout-spollock Thanks for creating this pull request. As @lommes has mentioned, The content in Please could you open a new pull request without the |
|
Archive.zip Modify .envIn the .env file, located in the root of the application, generally /var/www/boostack Add the following stanza: Add the OKTA IconAdd the file okta.svg to {bookstack root}/resources/assets/icons Add the Okta Provider fileAdd the file OktaProvider.php to {bookstack root}/vendor/laravel/socialite/src/Two/ Edit the Services.php fileIn {bookstack root}/config/services.php add the following: Edit the SocialAuthServices fileIn {bookstack root}/app/Services/SocialAuthService.php add to the variable $validSocialDrivers okta Edit the SocialiteManager fileIn {bookstack root}/vendor/laravel/socialite/src/SocialiteManager.php add thefollowing: ###Enable Registration through OKTA |
|
Bookstack does not ship with a vendor folder. All these files are downloaded when Since adding an additional socialite provider for okta seems to be a recurring request and the more providers BookStack supports the better, I will give this a shot and create pullrequest if it is achievebale in a proper way. |
|
I now have a working version without adding vendor. Since there are no packages which are actively maintained and the one i mentioned before is built for laravel 5.1 and socialite 2 there are still several problems. I tend to create an own provider from scratch for laravel 5.4+. Since it most likely would be exclusivly for bookstack and there now is a ticket to update bookstack to laravel 5.5, does it make sense to add a 5.4 compatible package now or wait for that update? It would be easier to fork the existing package and override it in composer.json using a custom repository which, in my opinion, is not a good practice for an app in production. @ssddanbrown what's your opinion on this? |
|
@lommes If you're creating a provider from scratch it's up to you how you like to integrate it really. I'll be upgrading You can either have the provider in your own repo, Which we can bring in via composer or, if it's easier for you and you don't mind, You can just place the files in the Thanks for your efforts so far on this. |
|
I just added #598 so I think this can be closed. |
|
Closing this now due to #598 being merged in. |
OKTA_URL=https://dev-454412.oktapreview.com/
OKTA_REDIRECT=http://servername/login/service/okta/callback
OKTA_CLIENT_ID=fsxxxxxxxdfg
OKTA_CLIENT_SECRET= fsdxxxxx-xxxxx-xxxxxx3
Replacing the OKTA_URL,OKTA_REDIRECT,OKTA_CLIENT_ID,OKTA_CLIENT_SECRET with your respective values.
You can sign up for a development account at developer.okta.com - the application type should be web, redirect URI: wiki.com/login/service/okta/callback
Manual installation steps are:
Add the file okta.svg to BookStack/resources/assets/icons
3.Add the file
BookStack/vendor/laravel/socialite/src/Two/OktaProvider.php
In BookStack/config/services.php
add
In BookStack/app/Services/SocialAuthService.php add to the variable $validSocialDrivers okta
i.e
protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure','okta'];
In BookStack/vendor/laravel/socialite/src/SocialiteManager.php add
public function createOktaDriver() {
$config = $this->app ['config'] ['services.okta'];
In BookStack/config/setting-defaults.php change registration-enabled to true
i.e 'registration-enabled' => true,