Skip to content

Sign-In With Ethereum

Sign-In With Ethereum is an open standard for authentication that enables users to control their digital identity with their Ethereum account. The integration uses the open-source OIDC Provider built by Login.xyz, which is hosted under oidc.signinwithethereum.org.

Follow this guide for instructions on how to set up Sign-In With Ethereum in WSO2 Identity Platform.

Register WSO2 Identity Platform in Sign-In With Ethereum

You need to register WSO2 Identity Platform as an OIDC client application in oidc.signinwithethereum.org.

Note

Follow the Sign-In With Ethereum documentation for detailed instructions.

To do so,

  1. Use the following curl command to register a new OIDC client.

    curl -X POST https://oidc.signinwithethereum.org/register
    -H 'Content-Type: application/json' -d  '{"redirect_uris": ["https://api.asgardeo.io/t/{organization_name}/commonauth"]}'
    
  2. Take note of the client_id and client_secret returned from the response.

    The following is an example response:

    {
        "client_id": "9b49de48-d198-47e7-afff-7ee26cbcbc95",
        "client_secret": "{secret}",
        "registration_access_token": "{access_token}",
        "registration_client_uri": "https://oidc.signinwithethereum.org/client/9b49de48-d198-47e7-afff-7ee26cbcbc95",
        "redirect_uris": ["https://api.asgardeo.io/t/{organization_name}/commonauth"]
    }
    

Register the Sign-In With Ethereum IdP

Follow the steps below to register the Sign-In With Ethereum IdP in WSO2 Identity Platform.

  1. On the WSO2 Identity Platform Console, go to Connections.
  2. Click Create Connection and select Sign-In With Ethereum.
  3. Enter the following details of the Sign-In With Ethereum identity provider and click Finish:

    Add Sign-In With Ethereum IDP in WSO2 Identity Platform

    Parameter Description
    Name A unique name for this Sign-In With Ethereum identity provider.
    Client ID The client ID obtained from oidc.signinwithethereum.org.
    Client secret The client secret obtained from oidc.signinwithethereum.org.

  4. In the created connection, go to the Settings tab and see the list of scopes to which Sign-In With Ethereum has granted permissions.

    • openid: Engages the OpenID flow.
    • profile: Allows to view the user's basic profile data.

    Note

    WSO2 Identity Platform needs these scopes to get user information. WSO2 Identity Platform checks the attribute configurations of the application and sends the relevant attributes received from Sign-In With Ethereum to the app.

Enable Sign-In With Ethereum

The following guide shows you how to enable Sign-In With Ethereum in an application.

Before you begin

You need to register an application with WSO2 Identity Platform. You can register your own application or use one of the sample applications provided.

  1. On the WSO2 Identity Platform Console, go to Applications.

  2. Select your application, go to the Login Flow tab and enable Sign-In With Ethereum using your preferred editor:


    To add enable Sign-In With Ethereum using the Classic Editor:

    1. If you haven't defined a sign-in flow for the application, click Start with Default configuration to define a login flow with a username and a password.

    2. Click Add Authentication in the same step as the default configuration.

    3. From the list of connections that appear, select the Sign-In With Ethereum connection that you created and click Add.

      Add Sign-In With Ethereum login in WSO2 Identity Platform

    To add enable Sign-In With Ethereum using the Visual Editor:

    1. Switch to the Visual Editor tab, by default the Username & Password login flow will be added onto the Visual Editor's workspace.

    2. Click on + Add Sign In Option to add a new authenticator to the same step and select the Sign-In With Ethereum connection that you created

      Enable sign-in with Ethereum in WSO2 Identity Platform using the Visual Editor


  3. Click Update to save the changes.

Try it out

Follow the steps given below.

  1. Access the application that you previously registered with WSO2 Identity Platform.
  2. Click Login to redirect to the WSO2 Identity Platform login page.
  3. On the WSO2 Identity Platform login page, choose the Sign-In With Ethereum IdP to log in.

    Note

    You will be redirected to the login interface of Sign-In With Ethereum.

    Sign-In With Ethereum on WSO2 Identity Platform

  4. Click Sign-In With Ethereum again to log in.

    Sign-In With Ethereum's Login Interface

  5. Select a preferred Ethereum wallet.

    Sign-In With Ethereum wallet selection

  6. Sign the login request to log in to the application.

    Sign-In With Ethereum request signing

Configure connection

To learn more about other configurations available for the connection, refer to the add federated login documentation.