Class OpenIdTokens
OpenID tokens: short-lived tokens a user hands to a service, which asks this server who they belong to through /_matrix/federation/v1/openid/userinfo.
Inherited Members
Namespace: Uniform.Matrix.Server.Accounts
Assembly: Uniform.Matrix.Server.dll
Syntax
public sealed class OpenIdTokens
Remarks
Tokens are kept in memory; they hold for OpenIdTokenLifetime and are lost on restart, after which clients ask for new ones.
Constructors
| Edit this page View SourceOpenIdTokens(IOptionsMonitor<CallOptions>, TimeProvider)
Create the store.
Declaration
public OpenIdTokens(IOptionsMonitor<CallOptions> options, TimeProvider time)
Parameters
| Type | Name | Description |
|---|---|---|
| IOptionsMonitor<CallOptions> | options | |
| TimeProvider | time |
Methods
| Edit this page View SourceIssue(string)
Return a new token of userId and how long it holds.
Declaration
public (string Token, TimeSpan Lifetime) Issue(string userId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId |
Returns
| Type | Description |
|---|---|
| (string Token, TimeSpan Lifetime) |
Validate(string?)
Return the user of a valid token, or null.
Declaration
public string? Validate(string? token)
Parameters
| Type | Name | Description |
|---|---|---|
| string | token |
Returns
| Type | Description |
|---|---|
| string |