Class RestApiMetadataExtensions
- Namespace
- Songhay.Extensions
- Assembly
- SonghayCore.dll
Extensions of RestApiMetadata.
public static class RestApiMetadataExtensions
- Inheritance
-
RestApiMetadataExtensions
- Inherited Members
Methods
ToAzureActiveDirectoryAccessTokenData(RestApiMetadata?)
Converts the specified RestApiMetadata to the data required by GetAccessTokenAsync(Uri?, Dictionary<string, string>?, Func<HttpClient>).
public static Dictionary<string, string> ToAzureActiveDirectoryAccessTokenData(this RestApiMetadata? meta)
Parameters
metaRestApiMetadatathe RestApiMetadata
Returns
Remarks
As of this writing, this member should return data of the form:
"grant_type": "client_credentials",
"scope": "https://vault.azure.net/.default",
"client_id": "active-directory-registration-app-id",
"client_secret": "active-directory-registration-app-secret"
where client_id is the value of the appId property
in the output of az ad app list;
client_secret is the secret exposed under the App registration in the Azure Portal.
🔬☔ test coverage of this member further documents how the RestApiMetadata should be formatted
ToAzureActiveDirectoryAccessTokenUri(RestApiMetadata?)
Converts the specified RestApiMetadata to the Uri required by GetAccessTokenAsync(Uri?, Dictionary<string, string>?, Func<HttpClient>).
public static Uri ToAzureActiveDirectoryAccessTokenUri(this RestApiMetadata? meta)
Parameters
metaRestApiMetadatathe RestApiMetadata
Returns
Remarks
This member should return a Uri of the form:
https://login.microsoftonline.com/{tenantOrDirectoryId}/oauth2/v2.0/token
where tenantOrDirectoryId is the value of “Directory (tenant) ID”
under the App registration in the Azure Portal.
🔬☔ test coverage of this member further documents how the RestApiMetadata should be formatted
ToAzureKeyVaultSecretUri(RestApiMetadata?, string)
Converts the specified RestApiMetadata to the Uri required by GetSecretAsync(string, Uri, Func<HttpClient>).
public static Uri ToAzureKeyVaultSecretUri(this RestApiMetadata? meta, string secretNameKey)
Parameters
metaRestApiMetadatathe RestApiMetadata
secretNameKeystringthe name of the Claim key that returns the Vault secret
Returns
Remarks
This member should return a Uri of the form:
https://{vaultName}.vault.azure.net/secrets/{secretName}?api-version=2016-10-01
where vaultName is the name of the Azure Key Vault;
secretName is the name of the secret in the vault.
🔬☔ test coverage of this member further documents how the RestApiMetadata should be formatted
ToUri(RestApiMetadata?, string?, params string?[])
Converts the specified RestApiMetadata to a Uri based on the specified URI Template.
public static Uri? ToUri(this RestApiMetadata? meta, string? uriTemplateKey, params string?[] bindByPositionValues)
Parameters
metaRestApiMetadatathe RestApiMetadata
uriTemplateKeystringThe URI template key.
bindByPositionValuesstring[]The bind by position values.