-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from /issues/25-LoginBadRequestHandling
- Loading branch information
Showing
7 changed files
with
132 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace EpicPrefill.Models | ||
{ | ||
//TODO document | ||
public static class BasicAuthentication | ||
{ | ||
public static AuthenticationHeaderValue ToAuthenticationHeader(string username, string password) | ||
{ | ||
string authenticationString = $"{username}:{password}"; | ||
byte[] inArray = Encoding.ASCII.GetBytes(authenticationString); | ||
var base64EncodedAuthenticationString = System.Convert.ToBase64String(inArray); | ||
|
||
return new AuthenticationHeaderValue("Basic", base64EncodedAuthenticationString); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace EpicPrefill.Models.Exceptions | ||
{ | ||
public class EpicLoginException : Exception | ||
{ | ||
protected EpicLoginException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
|
||
} | ||
|
||
public EpicLoginException() | ||
{ | ||
|
||
} | ||
|
||
public EpicLoginException(string message) : base(message) | ||
{ | ||
|
||
} | ||
|
||
public EpicLoginException(string message, Exception inner) : base(message, inner) | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters