Defines the properties and permissions of a user who has authenticated successfully and will be able to participate in the Ditto mesh.
More...
|
string | UserId [get, set] |
| Gets or sets the remote user's canonical user ID within an application. This does not have to be meaningful or unique but it may be useful to identify a user by their login or email address. More...
|
|
Dictionary< string, string > | UserInfo [get, set] |
| Gets or sets extra properties of their user such as location, job title, or any other metadata which may be needed when exploring other peers in the mesh. More...
|
|
DateTime | AccessExpires [get, set] |
| Gets or sets the time at which this login will expire. More...
|
|
DateTime | OfferRefreshUntil [get, set] |
| Gets or sets the time up to which a user may refresh their login without reauthentication. By having a shorter access expiry, they can be required to check in to get their latest permissions, without necessarily needing to supply their credentials again. More...
|
|
List< string > | Audiences [get, set] |
| Gets or sets the audiences for which the returned token is valid. Normally the default of ["sync"] is correct. More...
|
|
bool | ReadEverythingPermission [get, set] |
| Gets or sets a value indicating whether the user will be able to read every document in every collection. More...
|
|
bool | WriteEverythingPermission [get, set] |
| Gets or sets a value indicating whether the user will be able to write to every document in every collection. Note that write permissions are needed to share a document onward to another peer. More...
|
|
Dictionary< string, List< string > > | ReadPermissions [get, set] |
| Gets or sets the collection of read permissions. The keys are names of collections and the values are a list of queries. If a document matches one of the queries, then read permission is granted. More...
|
|
Dictionary< string, List< string > > | WritePermissions [get, set] |
| Gets or sets the collection of write permissions. The keys are names of collections and the values are a list of queries. If a document matches one of the queries, then write permission is granted. More...
|
|
Defines the properties and permissions of a user who has authenticated successfully and will be able to participate in the Ditto mesh.
◆ DittoAuthenticationSuccess()
DittoSDK.DittoAuthenticationSuccess.DittoAuthenticationSuccess |
( |
| ) |
|
|
inline |
Initializes a new instance of the DittoAuthenticationSuccess class.
At minimum you should configure:
-
UserId
is their canonical username. Consider that the same user may log in from multiple devices.
-
AccessExpires
must be set to a time in the future.
-
Permissions must be granted. This can be done by editing
ReadPermissions
and WritePermissions
directly, by using the helper methods for adding specific allowed queries, or by setting the "everything" booleans to permit the user to read or write.
The information contained in this response is signed so that it can be trusted by other peers in the mesh.
◆ AddReadPermissionForCollection()
void DittoSDK.DittoAuthenticationSuccess.AddReadPermissionForCollection |
( |
string |
collection, |
|
|
string |
query |
|
) |
| |
|
inline |
Adds a query for which the user should be able to read documents.
- Parameters
-
collection | Ditto collection name |
query | Ditto query string that matches the relevant documents |
◆ AddWritePermissionForCollection()
void DittoSDK.DittoAuthenticationSuccess.AddWritePermissionForCollection |
( |
string |
collection, |
|
|
string |
query |
|
) |
| |
|
inline |
Adds a query for which the user should be able to write or share documents.
- Parameters
-
collection | Ditto collection name |
query | Ditto query string that matches the relevant documents |
◆ AccessExpires
DateTime DittoSDK.DittoAuthenticationSuccess.AccessExpires |
|
getset |
Gets or sets the time at which this login will expire.
◆ Audiences
List<string> DittoSDK.DittoAuthenticationSuccess.Audiences |
|
getset |
Gets or sets the audiences for which the returned token is valid. Normally the default of ["sync"]
is correct.
◆ OfferRefreshUntil
DateTime DittoSDK.DittoAuthenticationSuccess.OfferRefreshUntil |
|
getset |
Gets or sets the time up to which a user may refresh their login without reauthentication. By having a shorter access expiry, they can be required to check in to get their latest permissions, without necessarily needing to supply their credentials again.
This is not yet implemented but may be used in future if specified.
◆ ReadEverythingPermission
bool DittoSDK.DittoAuthenticationSuccess.ReadEverythingPermission |
|
getset |
Gets or sets a value indicating whether the user will be able to read every document in every collection.
◆ ReadPermissions
Dictionary<string, List<string> > DittoSDK.DittoAuthenticationSuccess.ReadPermissions |
|
getset |
Gets or sets the collection of read permissions. The keys are names of collections and the values are a list of queries. If a document matches one of the queries, then read permission is granted.
◆ UserId
string DittoSDK.DittoAuthenticationSuccess.UserId |
|
getset |
Gets or sets the remote user's canonical user ID within an application. This does not have to be meaningful or unique but it may be useful to identify a user by their login or email address.
◆ UserInfo
Dictionary<string, string> DittoSDK.DittoAuthenticationSuccess.UserInfo |
|
getset |
Gets or sets extra properties of their user such as location, job title, or any other metadata which may be needed when exploring other peers in the mesh.
◆ WriteEverythingPermission
bool DittoSDK.DittoAuthenticationSuccess.WriteEverythingPermission |
|
getset |
Gets or sets a value indicating whether the user will be able to write to every document in every collection. Note that write permissions are needed to share a document onward to another peer.
◆ WritePermissions
Dictionary<string, List<string> > DittoSDK.DittoAuthenticationSuccess.WritePermissions |
|
getset |
Gets or sets the collection of write permissions. The keys are names of collections and the values are a list of queries. If a document matches one of the queries, then write permission is granted.