public void LoginAction(dk.nita.saml20.protocol.AbstractEndpointHandler handler, HttpContext context,
     dk.nita.saml20.Saml20Assertion assertion)
 {
     // Since FormsAuthentication is used in this sample, the user name to log can be found in context.User.Identity.Name.
     // This user will not be set until after a new redirect, so unfortunately we cannot just log it here,
     // but will have to do in MyPage.Load in order to log the local user id
 }
Esempio n. 2
0
 public void LogoutAction(dk.nita.saml20.protocol.AbstractEndpointHandler handler, HttpContext context, bool IdPInitiated)
 {
     // Example of logging required by the requirements SLO1 ("Id of internal user account")
     // Since FormsAuthentication is used in this sample, the user name to log can be found in context.User.Identity.Name
     // The login will be not be cleared until next redirect due to the way FormsAuthentication works, so we will have to check Saml20Identity.IsInitialized() too
     AuditLogging.logEntry(Direction.IN, Operation.LOGOUT, "ServiceProvider logout",
         "SP local user id: " + (context.User.Identity.IsAuthenticated ? context.User.Identity.Name : "none") + " login status: " + Saml20Identity.IsInitialized());
 }
Esempio n. 3
0
            private void Generate(StringBuilder builder, dk.brics.automaton.State state)
            {
                java.util.List transitions = state.getSortedTransitions(true);
                if (transitions.size() == 0)
                {
                    if (!state.isAccept())
                    {
                        throw new InvalidOperationException("state");
                    }

                    return;
                }

                int nroptions = state.isAccept() ? transitions.size() : transitions.size() - 1;
                int option = GetRandomInt(0, nroptions, random);
                if (state.isAccept() && option == 0)
                {
                    // 0 is considered stop.
                    return;
                }

                // Moving on to next transition.
                var transition = (dk.brics.automaton.Transition)transitions.get(option - (state.isAccept() ? 1 : 0));
                AppendChoice(builder, transition);
                Generate(builder, transition.getDest());
            }
Esempio n. 4
0
 private void AppendChoice(StringBuilder builder, dk.brics.automaton.Transition transition)
 {
     var c = (char)GetRandomInt(transition.getMin(), transition.getMax(), random);
     builder.Append(c);
 }