Skip to content

Commit a1d5ce3

Browse files
defguard-communitygitbook-bot
authored andcommitted
GITBOOK-467: defguard's Jul 30 changes
1 parent df6d698 commit a1d5ce3

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

.gitbook/assets/sso-example.png

14 KB
Loading

admin-and-features/openid-connect/README.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
# SSO (OpenID Connect)
1+
# Internal SSO (OpenID Connect Provider)
22

33
## OpenID Connect
44

55
### What is OpenID Connect?
66

7-
OpenID Connect is an identity layer built on top of OAuth2 it allows third-party applications to get basic information about your profile and verify your identity. Its purpose is to give you one login for multiple sites. You're probably familiar with it if you used **Login with Google**. For example, if you click Login with Google you'll be redirected to the Google page with verify form that you allow some website to get information from your profile for example email, name, etc.
7+
OpenID Connect is an identity layer built on top of OAuth2, it allows third-party applications to get basic information about your profile and verify your identity. Its purpose is to give you one login for multiple sites. You're probably familiar with it if you used **Login with Google**. For example, if you click Login with Google you'll be redirected to the Google page with verify form that you allow some website to get information from your profile for example email, name, etc.
8+
9+
### Defguard as an OpenID Connect Provider
10+
11+
Defguard is a full-featured OIDC provider enabling SSO (Single Sign-On) across third-party applications. Apps can authenticate users through Defguard identity system using standard [OIDC flow](./#defguard-openid-flow).  
12+
13+
Example:
14+
15+
<figure><img src="../../.gitbook/assets/sso-example.png" alt=""><figcaption></figcaption></figure>
16+
17+
818

919
### How Defguard implements OpenID?
1020

11-
As an identity provider one of our core features is Login with Defguard which allows you to log into other websites using your Defguard account so you don't have to care about multiple passwords and leaks. At this point you may have concern and ask is it safe? Yes, it's completely safe cause all information third party app will receive is the information that you allowed on redirect page. These information then are sent to third party app as IDToken which is basically JSON Web Token with additional claims like first name or email. Your password isn't send in any step of this.
21+
As an identity provider, one of our core features is Login with Defguard which allows you to log into other websites using your Defguard account so you don't have to care about multiple passwords and leaks. At this point you may have concern and ask is it safe? Yes, it's completely safe cause all information third party app will receive is the information that you allowed on the redirect page. This information then are sent to third party app as IDToken which is basically JSON Web Token with additional claims like first name or email. Your password isn't sent in any step of this.
1222

1323
### Defguard OpenID flow
1424

@@ -18,19 +28,19 @@ As an identity provider one of our core features is Login with Defguard which al
1828

1929
#### Client creation
2030

21-
To enable login with other app first you need to add it as new OpenID client. To do it navigate to OpenID Apps on the left side navigation then click Add new button.
31+
To enable login with other app first you need to add it as new OpenID client. To do it, navigate to OpenID Apps on the left side navigation, then click Add new button.
2232

2333
![OpenID add client form](../../.gitbook/assets/OpenIDForm.png)
2434

2535
Here are explained inputs
2636

27-
**Name** Name of your client **Redirect URI** URL on which user will be redirected with generated PKCE code example("https://myapp.com/redirect\_uri") **Scopes** Scopes which your client will be using
37+
**Name** of your client **Redirect URI** URL to which user will be redirected with generated PKCE code example("https://myapp.com/redirect\_uri") **Scopes** which your client will be using
2838

29-
After creating your client you can click on it on list and be redirected to detailed client page with it unique Client ID and Client secret codes.
39+
After creating your client, you can click on it on the list and be redirected to a detailed client page with it unique Client ID and Client secret codes.
3040

31-
**Client ID** is a public identifier for apps. Something like unique login so we can verify app URL matches it's Client ID. **Client Secret** Only known for authorization server(Defguard) and the applications as we using
41+
**Client ID** is a public identifier for apps. Something like unique login so we can verify app URL matches its Client ID. **Client Secret** Only known for authorization server(Defguard) and the applications as we are using
3242

33-
Setup on authorization app if you want to login with Defguard.
43+
Setup on authorization app if you want to log in with Defguard.
3444

3545
### OpenID endpoints
3646

@@ -54,9 +64,9 @@ OpenID Connect defines a discovery mechanism, called OpenID Connect Discovery, w
5464

5565
#### Authentication request
5666

57-
Set up your login with Defguard button to redirect to authorization endpoint which is `https://defguard.company.net/openid/authorize?`
67+
Set up your login with Defguard button to redirect to authorization endpoint, which is `https://defguard.company.net/openid/authorize?`
5868

59-
Below is sample authentication request which your app should do on Login with Defguard button
69+
Below is a sample authentication request which your app should do on Login with Defguard button
6070

6171
```
6272
http://defguard.company.net/api/v1/openid/authorize?
@@ -69,10 +79,10 @@ client_id=<YOUR_CLIENT_ID> // Generated by Defguard available on app detail page
6979

7080
**Notes:**
7181

72-
1. Client id and secret is generated by Defguard after creating your app you can see it on app detail page
82+
1. Client id and secret is generated by Defguard after creating your app, you can see it on app detail page
7383
2. **Scope** must contain OpenID
74-
3. Available scopes are profile(all available info from user profile) phone and email
75-
4. Currently only supported **response\_type** is **code**.
84+
3. Available scopes are profile (all available info from user profile) phone and email
85+
4. Currently, only supported **response\_type** is **code**.
7686
5. Redirect URI is URL on which user will be redirected with generated PKCE code (Redirect URI must match URI declared on client creation otherwise error will be returned)
7787

7888
**Successful authentication response**
@@ -87,7 +97,7 @@ code=SplxlOBeZQQYbYS6WxSbIA
8797

8898
#### Exchange code for ID Token
8999

90-
After receiving code from previous step you need to exchange it for token on token endpoint `defguard.company.net/api/v1/openid/token`
100+
After receiving code from previous step, you need to exchange it for token on token endpoint `defguard.company.net/api/v1/openid/token`
91101

92102
Request Header and URL:
93103

@@ -106,7 +116,7 @@ grant_type=authorization_code
106116

107117
**Note:**
108118

109-
1. Currently only supported **grant\_type** is authorization\_code
119+
1. Currently, only supported **grant\_type** is authorization\_code
110120
2. Code is your PKCE code received in previous step
111121

112122
**Successful Token Response**
@@ -133,11 +143,11 @@ grant_type=authorization_code
133143

134144
**Note:**
135145

136-
1. As we using HS256 algorithm ID Token is signed using your app Client Secret
146+
1. As we are using HS256 algorithm, ID Token is signed using your app Client Secret
137147

138148
**Authorized apps:**
139149

140-
Every user that used Login with Defguard option can see in his profile name of every authorized app. If you revoke app then you will have to click allow on form with permissions again.
150+
Every user that used Login with Defguard option can see in his profile name of every authorized app. If you revoke app, then you will have to click allow on the form with permissions again.
141151

142152
## OpenID clients
143153

0 commit comments

Comments
 (0)