Still working on getting client credential flow complete, most of the request works but still working on generating the JWT.
This commit is contained in:
parent
1a8c63808a
commit
8782ef39c6
80 changed files with 1331 additions and 414 deletions
20
IdentityShroud.Api.Tests/HeaderHelpersTests.cs
Normal file
20
IdentityShroud.Api.Tests/HeaderHelpersTests.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using IdentityShroud.Api.Helpers;
|
||||
|
||||
namespace IdentityShroud.Api.Tests;
|
||||
|
||||
public class HeaderHelpersTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Basic dXNlcjpzZWNyZXQ=", true, "user", "secret")]
|
||||
[InlineData("baSIC dXNlcjpzZWNyZXQ=", true, "user", "secret")]
|
||||
[InlineData("Basic dXNlcnNlY3JldA==", false, null, null)] // no colon to seperate user and password
|
||||
[InlineData("Bearer dXNlcjpzZWNyZXQ=", false, null, null)]
|
||||
public void TryDecodeBasicAuth(string input, bool expectedResult, string? expectedUser, string? expectedPassword)
|
||||
{
|
||||
var result = HeaderHelpers.TryDecodeBasicAuth(input, out string? user, out string? password);
|
||||
|
||||
Assert.Equal(expectedResult, result);
|
||||
Assert.Equal(expectedUser, user);
|
||||
Assert.Equal(expectedPassword, password);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue