Yes, it’s [nextcloud_login class=”btn”]button text[/nextcloud_login] and there is an option to enable a button on the WordPress login screen, or you can use the URL www.example.com/wp-login.php?nc-sso=redirect
Are there any filters available so I can make my own changes?
Yes, there is:
tims_nso_authorize_url which is the Nextcloud URL the user gets redirected to, and is also the last hook before they go off to your install of Nextcloud, example:
add_filter('tims_nso_nextcloud_login_button_url', 'custom_function_name_one');
function custom_function_name_one($authorize_url){
// custom code
return $authorize_url;
}
tims_nso_successful_login_redirect which is the URL the user goes to after successfully coming back from Nextcloud, example:
add_filter('tims_nso_successful_login_redirect', 'custom_function_name_two');
function custom_function_name_two($redirect_url){
// custom code
return $redirect_url;
}
tims_nso_nextcloud_login_button_url which is the URL the login button and shortcode login button uses, example:
add_filter('tims_nso_nextcloud_login_button_url', 'custom_function_name_three');
function custom_function_name_three($url){
// custom code
return $url;
}
tims_nso_nextcloud_user_matched which is the WordPress WP_User (Object) and the user data (Object) from Nextcloud for the successful matched user, example:
add_filter('tims_nso_nextcloud_user_matched', 'custom_function_name_four', 10, 2);
function custom_function_name_four($user,$nextcloud){
// custom code
return $user;
}
I’m getting a “Nextcloud server returned but with an invalid state for this session” error
Before you go off to Nextcloud the site needs to store a unique key to verify the response when you come back, if this key is removed before you come back this is when you see this message.
By default, the key is stored in the PHP session but if you’re having trouble you can go into the plugin options and set the “Temp Key Storage Type” to use a Cookie and this should solve the issue.
I’m stuck on my Nextcloud install when I click “Grant access”, it doesn’t do anything?
If you check the JS console log and see a message like “Refused to send form data to … because it violates the following Content Security Policy directive….” then you need to edit your Nextcloud config file, usually located at nextcloud/config/config.php and add the line: ‘overwriteprotocol’ => ‘https’,
Is there a paid version?
Nope, just a simple free plugin to enable you to login to your site with Nextcloud.
I need help
If you have any problems please reach out on the support forum or directly here. I’ll try my best to help.