FileCredentialStore
Namespace: E2E.OAuth
public sealed class FileCredentialStore : ICredentialStoreOne JSON file keyed by provider id, mode 0600. Writes hold an advisory lock and replace the file atomically, so two runs refreshing at once neither tear the file nor lose each other’s entries. Entries this store does not understand are kept as they are.
Inheritance: object
Implements: ICredentialStore
Constructors
Section titled “Constructors”FileCredentialStore(string)
Section titled “FileCredentialStore(string)”public FileCredentialStore(string path)Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Properties
Section titled “Properties”FilePath
Section titled “FilePath”public string FilePath { get; }Value: string
Methods
Section titled “Methods”GetAsync(string, CancellationToken)
Section titled “GetAsync(string, CancellationToken)”public Task<OAuthCredentials?> GetAsync(string providerId, CancellationToken cancellationToken = default)Parameters
| Name | Type | Description |
|---|---|---|
providerId |
string | |
cancellationToken |
CancellationToken |
Returns: Task<OAuthCredentials>
ListAsync(CancellationToken)
Section titled “ListAsync(CancellationToken)”public Task<IReadOnlyList<string>> ListAsync(CancellationToken cancellationToken = default)Every provider id with stored credentials.
Parameters
| Name | Type | Description |
|---|---|---|
cancellationToken |
CancellationToken |
Returns: Task<IReadOnlyList<string>>
RemoveAsync(string, CancellationToken)
Section titled “RemoveAsync(string, CancellationToken)”public Task<bool> RemoveAsync(string providerId, CancellationToken cancellationToken = default)Forgets the login. True when one was stored.
Parameters
| Name | Type | Description |
|---|---|---|
providerId |
string | |
cancellationToken |
CancellationToken |
Returns: Task<bool>
SetAsync(string, OAuthCredentials, CancellationToken)
Section titled “SetAsync(string, OAuthCredentials, CancellationToken)”public Task SetAsync(string providerId, OAuthCredentials credentials, CancellationToken cancellationToken = default)Parameters
| Name | Type | Description |
|---|---|---|
providerId |
string | |
credentials |
OAuthCredentials | |
cancellationToken |
CancellationToken |
Returns: Task