You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this tutorial you learn how to integrate Ethereum signatures with SAML to allow users to use their Ethereum wallets to authenticate themselves to web2 services that don't support Ethereum natively yet.
16
16
17
+
Note that this tutorial is written for two separate audiences:
18
+
19
+
- Ethereum people who understand Ethereum and need to learn SAML
20
+
- Web2 people who understand SAML and web2 authentication and need to learn Ethereum
21
+
22
+
As a result, it is going to contain a lot of introductory material that you already know. Feel free to skip it.
23
+
17
24
### SAML for Ethereum people
18
25
19
-
SAML is a centralized protocol. A service provider (SP) only accepts assertions (such as "this is my user John, he should have permissions to do A, B, and C") from an identity provider (IdP) if it has a pre-existing trust relationship with it.
26
+
SAML is a centralized protocol. A service provider (SP) only accepts assertions (such as "this is my user John, he should have permissions to do A, B, and C") from an identity provider (IdP) if it has a pre-existing trust relationship either with it, or with the [certificate authority](https://www.ssl.com/article/what-is-a-certificate-authority-ca/) that signed that IdP's certificate.
20
27
21
28
For example, the SP can be a travel agency providing travel services to companies, and the IdP can be a company's internal web site. When employees need to book business travel, the travel agency sends them for authentication by the company before letting them actually book travel.
22
29
@@ -86,21 +93,299 @@ Because of the decentralized nature of Ethereum, any user can make attestations.
86
93
87
94
## Setup
88
95
89
-
Create keys with self-signed certificates.
96
+
The first step is to have SAML SP and IdP communicating between themselves.
97
+
98
+
1. Download the software. The sample software for this article is [on github](https://github.com/qbzzt/250420-saml-ethereum). Different stages are stored in different branches, for this stage you want `saml-only`
2. Create keys with self-signed certificates. This means that the key is its own certificate authority, and needs to be imported manually to the service provider. See [the OpenSSL docs](https://docs.openssl.org/master/man1/openssl-req/) for more information.
4. Browse to the SP at URL [http://localhost:3000/](http://localhost:3000/) and click the button.
123
+
124
+
5. Provide the IdP with your e-mail address and click **Login to the service provider**. See that you get redirected to the service provider (port 3000) and that it knows you by your e-mail address.
console.log(`identity provider is running on http://${config.idpHostname}:${config.idpPort}`)
382
+
})
99
383
```
100
384
101
-
1. Introduction: Why do this?
102
-
1. SAML for Ethereum people
103
-
1. Ethereum for SAML people
385
+
386
+
387
+
388
+
104
389
1. Setup
105
390
1. Creating a SAML service provider (SP)
106
391
1. Creating a (for now) traditional SAML identity provider (IdP)
@@ -113,4 +398,4 @@ cd ..
113
398
1. Passing those user attributes to the SP.
114
399
1. Conclusion
115
400
1. When is this a good solution?
116
-
2. Using [MPC](https://ethresear.ch/c/cryptography/mpc/14) to remove the IdP's ability to cheat (just the idea, but I might implement it in a sequel article
401
+
2. Using [MPC](https://ethresear.ch/c/cryptography/mpc/14) to remove the IdP's ability to cheat (just the idea, but I might implement it in a sequel article)
0 commit comments