Skip to content

Commit 378f306

Browse files
authored
Merge pull request #38 from Altinn/feature/am-827_FixSupportForDashInAppName
PlatformAccessToken | Added support for dash (-) character in app name
2 parents 5f86989 + 60a210a commit 378f306

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

TokenGenerator/GetPlatformAccessToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public async Task<ActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "
3333
}
3434

3535
requestValidator.ValidateQueryParam("env", true, tokenHelper.IsValidEnvironment, out string env);
36-
requestValidator.ValidateQueryParam("app", true, tokenHelper.IsValidDottedIdentifier, out string appClaim);
36+
requestValidator.ValidateQueryParam("app", true, tokenHelper.IsValidIdentifier, out string appClaim);
3737
requestValidator.ValidateQueryParam("org", false, tokenHelper.IsValidIdentifier, out string issuerOrg);
3838
requestValidator.ValidateQueryParam<uint>("ttl", false, uint.TryParse, out uint ttl, 1800);
3939

TokenGenerator/Services/Token.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public bool TryParseScopes(string input, out string[] scopes)
334334

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

340340
public bool IsValidDottedIdentifier(string identifier)

0 commit comments

Comments
 (0)