Skip to content

Commit

Permalink
Change parameter name to match config name
Browse files Browse the repository at this point in the history
  • Loading branch information
elsand committed Dec 21, 2022
1 parent 32398a0 commit 16fa229
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ public interface IMaskinportenService
/// <summary>
/// Generates a Maskinporten access token using a JsonWebKey
/// </summary>
Task<TokenResponse> GetToken(JsonWebKey jwk, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false);
Task<TokenResponse> GetToken(JsonWebKey jwk, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false);

/// <summary>
/// Generates a Maskinporten access token using a X509Certificate
/// </summary>
Task<TokenResponse> GetToken(X509Certificate2 cert, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false);
Task<TokenResponse> GetToken(X509Certificate2 cert, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false);

/// <summary>
/// Generates a Maskinporten access token using a base64encoded JsonWebKey
/// </summary>
Task<TokenResponse> GetToken(string base64EncodedJWK, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false);
Task<TokenResponse> GetToken(string base64EncodedJWK, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false);

/// <summary>
/// Generates a access token based on supplied definition containing settings and secrets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ public MaskinportenService(HttpClient httpClient,
_tokenCacheProvider = tokenCacheProvider;
}

public async Task<TokenResponse> GetToken(X509Certificate2 cert, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false)
public async Task<TokenResponse> GetToken(X509Certificate2 cert, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false)
{
return await GetToken(cert, null, environment, clientId, scope, resource, consumerOrg, disableCaching);
return await GetToken(cert, null, environment, clientId, scope, resource, consumerOrgNo, disableCaching);
}

public async Task<TokenResponse> GetToken(JsonWebKey jwk, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false)
public async Task<TokenResponse> GetToken(JsonWebKey jwk, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false)
{
return await GetToken(null, jwk, environment, clientId, scope, resource, consumerOrg, disableCaching);
return await GetToken(null, jwk, environment, clientId, scope, resource, consumerOrgNo, disableCaching);
}

public async Task<TokenResponse> GetToken(string base64EncodedJwk, string environment, string clientId, string scope, string resource, string consumerOrg = null, bool disableCaching = false)
public async Task<TokenResponse> GetToken(string base64EncodedJwk, string environment, string clientId, string scope, string resource, string consumerOrgNo = null, bool disableCaching = false)
{
byte[] base64EncodedBytes = Convert.FromBase64String(base64EncodedJwk);
string jwkjson = Encoding.UTF8.GetString(base64EncodedBytes);
JsonWebKey jwk = new JsonWebKey(jwkjson);
return await GetToken(null, jwk, environment, clientId, scope, resource, consumerOrg, disableCaching);
return await GetToken(null, jwk, environment, clientId, scope, resource, consumerOrgNo, disableCaching);
}

public async Task<TokenResponse> GetToken(IClientDefinition clientDefinition, bool disableCaching = false)
Expand Down

0 comments on commit 16fa229

Please sign in to comment.