This file contains hidden or 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
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Digests; | |
using Org.BouncyCastle.Crypto.Encodings; | |
using Org.BouncyCastle.Crypto.Engines; | |
using Org.BouncyCastle.Crypto.Generators; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.Security; |
This file contains hidden or 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
using System; | |
using System.Security.Cryptography; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Digests; | |
using Org.BouncyCastle.Crypto.Encodings; | |
using Org.BouncyCastle.Crypto.Engines; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.Security; | |
namespace BCMediumConsoleApp |
This file contains hidden or 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
// Headers e.g. | |
// string header2048 = "0602000000A40000525341310008000001000100"; | |
private byte[] CreatePublicKey(byte[] publicKey) | |
{ | |
byte[] publicKey = new byte[publicKey.Length]; | |
byte[] header = null; | |
foreach (KeyValuePair<int, string> keyPair in headersList) |
This file contains hidden or 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
app.UseIdentityServer(); | |
// Use SAML middleware. | |
app.UseSaml(); | |
// Specify the display name and return URL for logout. | |
app.Use(async (context, next) => | |
{ | |
if (context.Request.Path.Value.Equals("/Account/Logout", StringComparison.OrdinalIgnoreCase) && | |
string.IsNullOrEmpty(context.Request.Query["logoutId"])) | |
{ |
This file contains hidden or 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
{ | |
"Name": "https://IdentityServer4", | |
"Description": "IdentityServer4", | |
"SignAuthnRequest": true, | |
"SingleSignOnServiceUrl": "http://localhost:6000/SAML/SingleSignOnService", | |
"SingleLogoutServiceUrl": "http://localhost:6000/SAML/SingleLogoutService", | |
"PartnerCertificates": [ | |
{ | |
"FileName": "certificates/idp.cer" | |
} |
This file contains hidden or 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
// SAML client | |
new Client | |
{ | |
ClientId = "https://IdentityServer4", | |
ClientName = "idsrv4 CS", | |
ProtocolType = IdentityServerConstants.ProtocolTypes.Saml2p, | |
AllowedScopes = {"openid", "profile"} | |
} | |
... |
This file contains hidden or 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
<ContentDefinitions> | |
<!-- This content definition is to render an error page that displays unhandled errors. --> | |
<ContentDefinition Id="api.error"> | |
<LoadUri>~/tenant/default/exception.cshtml</LoadUri> | |
<RecoveryUri>~/common/default_page_error.html</RecoveryUri> | |
<!-- <DataUri>urn:com:microsoft:aad:b2c:elements:globalexception:1.1.0</DataUri> --> | |
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:globalexception:1.1.0</DataUri> | |
<Metadata> | |
<Item Key="DisplayName">Error page</Item> |
This file contains hidden or 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
// Part of the file | |
<ContentDefinition Id="api.localaccountsignup"> | |
... | |
<Metadata> | |
<Item Key="DisplayName">Local account sign up page</Item> | |
</Metadata> | |
<LocalizedResourcesReferences MergeBehavior="Prepend"> | |
<LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" /> | |
</LocalizedResourcesReferences> |
This file contains hidden or 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
// Part of the file | |
<ContentDefinition Id="api.localaccountsignup"> | |
... | |
<Metadata> | |
<Item Key="DisplayName">Local account sign up page</Item> | |
</Metadata> | |
<LocalizedResourcesReferences MergeBehavior="Prepend"> | |
<LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.localaccountsignup.en" /> | |
</LocalizedResourcesReferences> |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
This file contains hidden or 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
Functions,,Azure AD,Azure AD B2C,ADFS 3.0,ADFS 4.0,identityserver,Auth0 | |
,,,,,,, | |
Authenticate against,,Azure AD,"Azure AD | |
(but different tenant type to AAD)",AD,"AD | |
LDAP v3.0",Anything,"AD | |
LDAP | |
SQL DB | |
Auth0 repository" | |
,,,,,,, | |
"WS-Federation |