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

Adding a new filter for the auth token #169

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions aad-sso-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ function authenticate( $user, $username, $password ) {
// Looks like we got a valid authorization code, let's try to get an access token with it
$token = AADSSO_AuthorizationHelper::get_access_token( $_GET['code'], $this->settings );

/**
* Allow filtering of the token in order to use alternate AAD applications to sign in.
*
* @param mixed $token The token returned from the standard auth call
* @param string The $_GET['code'] variable
* @param \AADSSO_Settings The settings object for the AADSSO instance.
* @since 0.6.2
*
* @return mixed
*/
$token = apply_filters( 'addsso_auth_token', $token, $_GET['code'], $this->settings );

// Happy path
if ( isset( $token->access_token ) ) {

Expand Down