Skip to content

Commit 196e613

Browse files
Merge pull request #125 from pantheon-systems/error-no-attributes
Provide an error message explicitly for when attributes are missing
2 parents f7b2f77 + f396a28 commit 196e613

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

inc/class-wp-saml-auth.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ public function do_saml_authentication() {
290290
return $pre_auth;
291291
}
292292

293+
if ( empty( $attributes ) ) {
294+
return new WP_Error( 'wp_saml_auth_no_attributes', esc_html__( 'No attributes were present in SAML response. Attributes are used to create and fetch users. Please contact your administrator', 'wp-saml-auth' ) );
295+
}
296+
293297
$get_user_by = self::get_option( 'get_user_by' );
294298
$attribute = self::get_option( "user_{$get_user_by}_attribute" );
295299
if ( empty( $attributes[ $attribute ][0] ) ) {

0 commit comments

Comments
 (0)