Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for use of env variables to set redirect URIs #173

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AuthorizationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function get_authorization_url( $settings, $antiforgery_id ) {
'domain_hint' => $settings->org_domain_hint,
'client_id' => $settings->client_id,
'resource' => $settings->graph_endpoint,
'redirect_uri' => $settings->redirect_uri,
'redirect_uri' => apply_filters('aadsso_login_redirect_uri', $settings->redirect_uri),
'state' => $antiforgery_id,
'nonce' => $antiforgery_id,
) );
Expand All @@ -49,7 +49,7 @@ public static function get_access_token( $code, $settings ) {
array(
'grant_type' => 'authorization_code',
'code' => $code,
'redirect_uri' => $settings->redirect_uri,
'redirect_uri' => apply_filters('aadsso_login_redirect_uri', $settings->redirect_uri),
'resource' => $settings->graph_endpoint,
'client_id' => $settings->client_id,
'client_secret' => $settings->client_secret
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sign Sign-on with Azure Active Directory (for WordPress)
# Single Sign-on with Azure Active Directory (for WordPress)

A WordPress plugin that allows organizations to use their Azure Active Directory
user accounts to sign in to WordPress. Organizations with Office 365 already have
Expand Down
3 changes: 1 addition & 2 deletions aad-sso-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,8 @@ function get_login_url() {
* Generates the URL for logging out of Azure AD. (Does not log out of WordPress.)
*/
function get_logout_url() {

// logout_redirect_uri is not a required setting, use default value if none is set
$logout_redirect_uri = $this->settings->logout_redirect_uri;
$logout_redirect_uri = apply_filters('aadsso_logout_redirect_uri', $this->settings->logout_redirect_uri);
if ( empty( $logout_redirect_uri ) ) {
$logout_redirect_uri = AADSSO_Settings::get_defaults('logout_redirect_uri');
}
Expand Down