• Resolved dbthorburn

    (@dbthorburn)


    Using WP SAML Auth integrated with SimpleSAMLphp, everything works great and loving it so far. Setting the baked-in attributes (user_login_attribute, user_email_attribute, display_name_attribute, first_name_attribute, last_name_attribute) from the SAML response is easy and works great also, but now I am wondering if it is possible to set custom user profile fields? I have created a custom plugin that adds custom user profile fields using the update_usermeta() function, but now I want to be able to extract data from the SAML response and set those custom fields when a user authenticates. Any help is greatly appreciated.

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Hi @dbthorburn,

    You can use the wp_saml_auth_new_user_authenticated action to handle additional response attributes. Here’s an untested example:

    
    add_action( 'wp_saml_auth_new_user_authenticated', function( $user, $attributes ) {
        update_post_meta( $user->ID, 'foo', $attributes['foo'] );
    }, 10, 2 );
    

    You’ll need to inspect the $attributes variable for the attributes you’d like to store.

Viewing 1 replies (of 1 total)
  • The topic ‘Additional User Attributes’ is closed to new replies.