コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: thisisata/SAML_Teste
        private static void AddAuthenticationStatement(Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityToken token)
        {
            // Chage to "urn:oasis:names:tc:SAML:2.0:ac:classes:Password" or something.
            var authenticationMethod = "urn:none";

            var authenticationContext   = new Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthenticationContext(new Uri(authenticationMethod));
            var authenticationStatement = new Microsoft.IdentityModel.Tokens.Saml2.Saml2AuthenticationStatement(authenticationContext);

            token.Assertion.Statements.Add(authenticationStatement);
        }
コード例 #2
0
 /// <summary>
 /// Creates an instance of Saml2AuthenticationContext.
 /// </summary>
 /// <param name="authenticationContext">The authentication context of this statement.</param>
 /// <param name="authenticationInstant">The time of the authentication.</param>
 /// <exception cref="ArgumentNullException">if <paramref name="authenticationContext"/> is null.</exception>
 public Saml2AuthenticationStatement(Saml2AuthenticationContext authenticationContext, DateTime authenticationInstant)
 {
     AuthenticationContext = authenticationContext;
     AuthenticationInstant = authenticationInstant;
 }
コード例 #3
0
 /// <summary>
 /// Creates a Saml2AuthenticationStatement.
 /// </summary>
 /// <param name="authenticationContext">The authentication context of this statement.</param>
 public Saml2AuthenticationStatement(Saml2AuthenticationContext authenticationContext)
     : this(authenticationContext, DateTime.UtcNow)
 {
 }