updated core to 7.73
This commit is contained in:
@@ -365,14 +365,20 @@ function openid_complete($response = array()) {
|
||||
// to the OpenID Provider, we need to do discovery on the returned
|
||||
// identififer to make sure that the provider is authorized to
|
||||
// respond on behalf of this.
|
||||
if ($response_claimed_id != $claimed_id) {
|
||||
if ($response_claimed_id != $claimed_id || $response_claimed_id != $response['openid.identity']) {
|
||||
$discovery = openid_discovery($response['openid.claimed_id']);
|
||||
$uris = array();
|
||||
if ($discovery && !empty($discovery['services'])) {
|
||||
$uris = array();
|
||||
foreach ($discovery['services'] as $discovered_service) {
|
||||
if (in_array('http://specs.openid.net/auth/2.0/server', $discovered_service['types']) || in_array('http://specs.openid.net/auth/2.0/signon', $discovered_service['types'])) {
|
||||
$uris[] = $discovered_service['uri'];
|
||||
if (!in_array('http://specs.openid.net/auth/2.0/server', $discovered_service['types']) && !in_array('http://specs.openid.net/auth/2.0/signon', $discovered_service['types'])) {
|
||||
continue;
|
||||
}
|
||||
// The OP-Local Identifier (if different than the Claimed
|
||||
// Identifier) must be present in the XRDS document.
|
||||
if ($response_claimed_id != $response['openid.identity'] && (!isset($discovered_service['identity']) || $discovered_service['identity'] != $response['openid.identity'])) {
|
||||
continue;
|
||||
}
|
||||
$uris[] = $discovered_service['uri'];
|
||||
}
|
||||
}
|
||||
if (!in_array($service['uri'], $uris)) {
|
||||
@@ -839,7 +845,7 @@ function openid_verify_assertion($service, $response) {
|
||||
// direct verification: ignore the openid.assoc_handle, even if present.
|
||||
// See http://openid.net/specs/openid-authentication-2_0.html#rfc.section.11.4.1
|
||||
if (!empty($response['openid.assoc_handle']) && empty($response['openid.invalidate_handle'])) {
|
||||
$association = db_query("SELECT * FROM {openid_association} WHERE assoc_handle = :assoc_handle", array(':assoc_handle' => $response['openid.assoc_handle']))->fetchObject();
|
||||
$association = db_query("SELECT * FROM {openid_association} WHERE idp_endpoint_uri = :endpoint AND assoc_handle = :assoc_handle", array(':endpoint' => $service['uri'], ':assoc_handle' => $response['openid.assoc_handle']))->fetchObject();
|
||||
}
|
||||
|
||||
if ($association && isset($association->session_type)) {
|
||||
@@ -871,6 +877,7 @@ function openid_verify_assertion($service, $response) {
|
||||
// database to avoid reusing it again on a subsequent authentication request.
|
||||
// See http://openid.net/specs/openid-authentication-2_0.html#rfc.section.11.4.2.2
|
||||
db_delete('openid_association')
|
||||
->condition('idp_endpoint_uri', $service['uri'])
|
||||
->condition('assoc_handle', $response['invalidate_handle'])
|
||||
->execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user