mirror of
https://gitee.com/dcren/openiddict-documentation.git
synced 2026-03-23 17:53:26 +08:00
Update the documentation pages
This commit is contained in:
@@ -228,7 +228,40 @@ if (await manager.FindByClientIdAsync("console") == null)
|
||||
<p>Scope permissions limit the scopes (standard or custom) a client application is allowed to use.</p>
|
||||
<blockquote><p>The <code>openid</code> and <code>offline_access</code> scopes are special-cased by OpenIddict and don't require explicit permissions.</p>
|
||||
</blockquote>
|
||||
<h3 id="example">Example</h3>
|
||||
<h3 id="supported-permissions">Supported permissions</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center">Scope</th>
|
||||
<th style="text-align:center">Constant</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:center">address</td>
|
||||
<td style="text-align:center"><code>OpenIddictConstants.Permissions.Scopes.Address</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center">email</td>
|
||||
<td style="text-align:center"><code>OpenIddictConstants.Permissions.Scopes.Email</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center">phone</td>
|
||||
<td style="text-align:center"><code>OpenIddictConstants.Permissions.Scopes.Phone</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center">profile</td>
|
||||
<td style="text-align:center"><code>OpenIddictConstants.Permissions.Scopes.Profile</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center">roles</td>
|
||||
<td style="text-align:center"><code>OpenIddictConstants.Permissions.Scopes.Roles</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>To add a custom scope permission, you can use the following pattern:</p>
|
||||
<pre><code class="lang-csharp">OpenIddictConstants.Permissions.Prefixes.Scope + "custom_scope_name"
|
||||
</code></pre><h3 id="example">Example</h3>
|
||||
<p>In the following sample, the <code>angular</code> client is allowed to request the <code>address</code>,
|
||||
<code>profile</code> and <code>marketing_api</code> scopes: any other scope will result in an error being returned.</p>
|
||||
<pre><code class="lang-csharp">if (await manager.FindByClientIdAsync("angular") == null)
|
||||
|
||||
Reference in New Issue
Block a user