Skip to content

Commit

Permalink
Merge pull request #38 from Altinn/feature/am-827_FixSupportForDashIn…
Browse files Browse the repository at this point in the history
…AppName

PlatformAccessToken | Added support for dash (-) character in app name
  • Loading branch information
jonkjetiloye authored Sep 27, 2024
2 parents 5f86989 + 60a210a commit 378f306
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TokenGenerator/GetPlatformAccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<ActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "
}

requestValidator.ValidateQueryParam("env", true, tokenHelper.IsValidEnvironment, out string env);
requestValidator.ValidateQueryParam("app", true, tokenHelper.IsValidDottedIdentifier, out string appClaim);
requestValidator.ValidateQueryParam("app", true, tokenHelper.IsValidIdentifier, out string appClaim);
requestValidator.ValidateQueryParam("org", false, tokenHelper.IsValidIdentifier, out string issuerOrg);
requestValidator.ValidateQueryParam<uint>("ttl", false, uint.TryParse, out uint ttl, 1800);

Expand Down
2 changes: 1 addition & 1 deletion TokenGenerator/Services/Token.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public bool TryParseScopes(string input, out string[] scopes)

public bool IsValidIdentifier(string identifier)
{
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[a-z0-9_]+$");
return !string.IsNullOrEmpty(identifier) && identifier.Length <= 50 && Regex.IsMatch(identifier, "^[a-z0-9_-]+$");
}

public bool IsValidDottedIdentifier(string identifier)
Expand Down

0 comments on commit 378f306

Please sign in to comment.