GNUnet preparation ================== Setup zone for RP: gnunet-identity -C martin Extracted from OpenID connect button 'redirect_uri': http://127.0.0.1:9999/wp-admin/admin-ajax.php?action/openid-connect-authorize gnunet-namestore -a -z martin -n @ -t RECLAIM_OIDC_REDIRECT -V http://127.0.0.1:9999/wp-admin/admin-ajax.php?action=openid-connect-authorize -e 1h -p # Set name of Web site ("wootaler") to be shown to user: gnunet-namestore -a -z martin -n @ -t RECLAIM_OIDC_CLIENT -V wootaler -e 1h -p OIDC setup in WooCommerce ================================== Install OIDC plugin: sudo -u www-data wp --user=admin plugin install daggerhart-openid-connect-generic --activate Find existing settings: sudo -u www-data wp --user=admin option list => find out how to modify! OpenID client ID is public key of identity: $ gnunet-identity -d -e martin So: 50BMJB6S9MV22BTG541G6XPQVNT7BNT7DZ3ZCCEZXFZPKV3915N0 Authorize Endpoint definieren im OpenID Connect Wordpress plugin zu ("Login Endpoint URL"): https://api.reclaim/openid/authorize Client secret key: Siehe: gnunet-config -s reclaim-rest-plugin -o OIDC_CLIENT_SECRET default "secret" OpenID scope: list of desired attributes: "openid profile email full_name" ... Token Validation Endpoint URL - wo GNUnet REST API erreichbar: Default is: http://localhost:7776/openid/token Userinfo Endpoint URL - analog: http://localhost:7776/openid/token/userinfo Identity key: immer "sub" Nickname key: gut: full_name Display name formatting: {full_name} Identify with username: check box =========================== Reclaim plugin installieren: https://addons.mozilla.org/en-US/firefox/addon/reclaimid/ GNUnet "lokal" installieren Beide peers (WooCommerce+Reclaim und localen GNUnet peer "verbinden") -- oder beim Export von GNUnet via qemu: bind_to von REST auf 0.0.0.0 setzen, damit Qemu zugriff erlaubt. ============================= Integration Notes: ================== Add OIDC button using (either) get_checkout_fields( 'account' ) ) : ?>
get_checkout_fields( 'account' ) as $key => $field ) : ?> get_value( $key ) ); ?>
of those hooks from https://github.com/woocommerce/woocommerce/blob/bdf77f5648fb44b86b19ac4f8a01536b1ee6baa1/templates/checkout/form-billing.php => ideal: call hook of OIDC plugin that OIDC plugin installed for the 'main' login button of WordPress. OIDC plugin uses existing hook (see includes/openid-connect-generic-login-form.php) as this: >>> $login_form = new self( $settings, $client_wrapper ); add_filter( 'login_message', array( $login_form, 'handle_login_page' ), 99 ); add_shortcode( 'openid_connect_generic_login_button', array( $login_form, 'make_login_button' ) ); <<< so something like this must be added to the hook above! daggerhart-openid-connect-generic ================================= Modify "Login with OpenID" to "Login with Re:claimID" using this hook: #### `openid-connect-generic-login-button-text` Modify the login button text. Default value is `__( 'Login with OpenID Connect' )`. Provides 1 argument: the current login button text. ``` add_filter('openid-connect-generic-login-button-text', function( $text ) { $text = __('Login to my super cool IDP server'); return $text; }); ``` * `openid-connect-generic-last-id-token-claim` - The user's most recent `id_token` claim, decoded and stored as an array. => here is the data we want from the user (to put into the woocommerce form)