Skip to content

Commit

Permalink
Remove additional unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Dec 5, 2019
1 parent a411a5a commit e7ae43d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
2 changes: 1 addition & 1 deletion lib/WP_Auth0_Api_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public static function create_client( $domain, $app_token, $name ) {
'web_origins' => $options->get_web_origins(),

// Force SSL, will not work without it
'cross_origin_loc' => $options->get_cross_origin_loc(),
'cross_origin_loc' => add_query_arg( 'auth0fallback', '1', site_url( 'index.php', 'https' ) ),
'cross_origin_auth' => true,

// A set of URLs that are valid to redirect to after logout from Auth0
Expand Down
61 changes: 0 additions & 61 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,49 +250,6 @@ public function get_default( $key ) {
return $defaults[ $key ];
}

/**
* Get the stored token signing algorithm
*
* @return string
*/
public function get_client_signing_algorithm() {
return $this->get( 'client_signing_algorithm', WP_Auth0_Api_Client::DEFAULT_CLIENT_ALG );
}

/**
* Get the currently-stored client ID as a JWT key
*
* @param bool $legacy - legacy installs did not provide RS256, forces HS256
*
* @return bool|string
*/
public function get_client_secret_as_key( $legacy = false ) {
return $this->convert_client_secret_to_key(
$this->get( 'client_secret', '' ),
$this->get( 'client_secret_b64_encoded', false ),
( $legacy ? false : $this->get_client_signing_algorithm() === 'RS256' ),
$this->get_auth_domain()
);
}

/**
* Convert a client_secret value into a JWT key
*
* @param string $secret - client_secret value
* @param bool $is_encoded - is the client_secret base64 encoded?
* @param bool $is_RS256 - if true, use RS256; if false, use HS256
* @param string $domain - tenant domain
*
* @return array|bool|mixed|string
*/
public function convert_client_secret_to_key( $secret, $is_encoded, $is_RS256, $domain ) {
if ( $is_RS256 ) {
return ( new WP_Auth0_JwksFetcher() )->getKeys();
} else {
return $is_encoded ? wp_auth0_url_base64_decode( $secret ) : $secret;
}
}

/**
* Get web_origin settings for new Clients
*
Expand Down Expand Up @@ -326,24 +283,6 @@ public function get_wp_auth0_url( $protocol = null ) {
return add_query_arg( 'auth0', 1, $site_url );
}

/**
* Get get_cross_origin_loc URL for new Clients
*
* @return string
*/
public function get_cross_origin_loc() {
return add_query_arg( 'auth0fallback', '1', site_url( 'index.php', 'https' ) );
}

/**
* Get the main site logout URL, minus a nonce
*
* @return string
*/
public function get_logout_url() {
return add_query_arg( 'action', 'logout', site_url( 'wp-login.php', 'login' ) );
}

/**
* Get a custom Lock URL or the default, depending on settings.
*
Expand Down

0 comments on commit e7ae43d

Please sign in to comment.