<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font face="Ubuntu">My fault, it was a scoping issue with my
        bean, I change scope="prototype" and all is good.  <br>
      </font></p>
    <p><font face="Ubuntu"><br>
      </font></p>
    <font face="Ubuntu">Thanks<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 09/26/2016 08:30 AM, Charles
      Syperski wrote:<br>
    </div>
    <blockquote
      cite="mid:72fd6913-60c5-f5a9-704e-d6b539d4bfe8@dupage88.net"
      type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <p><font face="Ubuntu">I am having an issue with my  IDP
          authenticating again a custom </font>AbstractUserPasswordValidationAction.... 
        The first request/user works fine and can authentication and
        gets processed, but the 2nd and on fail with a response of "An
        error occured"<br>
      </p>
      <p><br>
      </p>
      <p>I am getting the following error:</p>
      <p><br>
      </p>
      <p>oder.doDecode(HTTPPostDecoder.java:57)<br>
        2016-09-26 07:00:35,496 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request: UnableToDecode<br>
        2016-09-26 07:00:54,049 - ERROR
        [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78]
        - Profile Action SelectSubjectCanonicalizationFlow: No potential
        flows left to choose from, canonicalization will fail<br>
        2016-09-26 07:00:54,050 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request:
        SubjectCanonicalizationError<br>
        2016-09-26 07:02:21,223 - ERROR
        [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78]
        - Profile Action SelectSubjectCanonicalizationFlow: No potential
        flows left to choose from, canonicalization will fail<br>
        2016-09-26 07:02:21,223 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request:
        SubjectCanonicalizationError<br>
        2016-09-26 07:02:31,380 - ERROR
        [org.opensaml.profile.action.impl.DecodeMessage:73] - Profile
        Action DecodeMessage: Unable to decode incoming request<br>
        org.opensaml.messaging.decoder.MessageDecodingException: This
        message decoder only supports the HTTP POST method<br>
            at
org.opensaml.saml.saml2.binding.decoding.impl.HTTPPostDecoder.doDecode(HTTPPostDecoder.java:57)<br>
        2016-09-26 07:02:31,382 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request: UnableToDecode<br>
        2016-09-26 07:05:04,591 - ERROR
        [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78]
        - Profile Action SelectSubjectCanonicalizationFlow: No potential
        flows left to choose from, canonicalization will fail<br>
        2016-09-26 07:05:04,592 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request:
        SubjectCanonicalizationError<br>
        2016-09-26 07:05:07,560 - ERROR
        [org.opensaml.profile.action.impl.DecodeMessage:73] - Profile
        Action DecodeMessage: Unable to decode incoming request<br>
        org.opensaml.messaging.decoder.MessageDecodingException: This
        message decoder only supports the HTTP POST method<br>
            at
org.opensaml.saml.saml2.binding.decoding.impl.HTTPPostDecoder.doDecode(HTTPPostDecoder.java:57)<br>
        2016-09-26 07:05:07,560 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request: UnableToDecode<br>
        2016-09-26 07:06:43,449 - WARN
[net.dupage88.usercentralsaml.authn.ValidateUsernamePasswordAgainstUCM:98]
        - Login Failed: [<a moz-do-not-send="true"
          class="moz-txt-link-abbreviated"
          href="mailto:christine.pahopos@sbcglobal.net">christine.pahopos@sbcglobal.net</a>]
        Authentication failed! - InvalidCredentials<br>
        2016-09-26 07:07:11,572 - ERROR
        [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78]
        - Profile Action SelectSubjectCanonicalizationFlow: No potential
        flows left to choose from, canonicalization will fail<br>
        2016-09-26 07:07:11,573 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request:
        SubjectCanonicalizationError<br>
        2016-09-26 07:07:49,955 - ERROR
        [org.opensaml.profile.action.impl.DecodeMessage:73] - Profile
        Action DecodeMessage: Unable to decode incoming request<br>
        org.opensaml.messaging.decoder.MessageDecodingException: This
        message decoder only supports the HTTP POST method<br>
            at
org.opensaml.saml.saml2.binding.decoding.impl.HTTPPostDecoder.doDecode(HTTPPostDecoder.java:57)<br>
        2016-09-26 07:07:49,955 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request: UnableToDecode<br>
        2016-09-26 07:07:51,452 - ERROR
        [org.opensaml.profile.action.impl.DecodeMessage:73] - Profile
        Action DecodeMessage: Unable to decode incoming request<br>
        org.opensaml.messaging.decoder.MessageDecodingException: This
        message decoder only supports the HTTP POST method<br>
            at
org.opensaml.saml.saml2.binding.decoding.impl.HTTPPostDecoder.doDecode(HTTPPostDecoder.java:57)<br>
        2016-09-26 07:07:51,453 - WARN
        [org.opensaml.profile.action.impl.LogEvent:76] - An error event
        occurred while processing the request: UnableToDecode<br>
        2016-09-26 07:08:35,798 - ERROR
        [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78]
        - Profile Action </p>
      <p><br>
      </p>
      <p><br>
      </p>
      <p>Here is my class that extends
        AbstractUsernamePasswordValidationAction.....</p>
      <p><br>
      </p>
      <p>
        <meta http-equiv="content-type" content="text/html;
          charset=windows-1252">
      </p>
      <pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9.0pt;"><span style="color:#000080;font-weight:bold;">package </span>net.dupage88.usercentralsaml.authn;

<span style="color:#000080;font-weight:bold;">import </span>net.dupage88.usercentrallite.authmethod.PasswordAuthMethod;
<span style="color:#000080;font-weight:bold;">import </span>net.dupage88.usercentrallite.manager.AuthenticationManager;
<span style="color:#000080;font-weight:bold;">import </span>net.dupage88.usercentrallite.users.GuardianUser;
<span style="color:#000080;font-weight:bold;">import </span>net.dupage88.usercentrallite.users.User;
<span style="color:#000080;font-weight:bold;">import </span>net.dupage88.usercentralsaml.authn.context.UcmResponseContext;
<span style="color:#000080;font-weight:bold;">import </span>net.shibboleth.idp.authn.AbstractUsernamePasswordValidationAction;
<span style="color:#000080;font-weight:bold;">import </span>net.shibboleth.idp.authn.AuthnEventIds;
<span style="color:#000080;font-weight:bold;">import </span>net.shibboleth.idp.authn.context.AuthenticationContext;
<span style="color:#000080;font-weight:bold;">import </span><span style="color:#808000;">net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty</span>;
<span style="color:#000080;font-weight:bold;">import </span>org.apache.velocity.VelocityContext;
<span style="color:#000080;font-weight:bold;">import </span>org.opensaml.profile.context.ProfileRequestContext;
<span style="color:#000080;font-weight:bold;">import </span>org.slf4j.Logger;
<span style="color:#000080;font-weight:bold;">import </span>org.slf4j.LoggerFactory;

<span style="color:#000080;font-weight:bold;">import </span><span style="color:#808000;">javax.annotation.Nonnull</span>;
<span style="color:#000080;font-weight:bold;">import </span><span style="color:#808000;">javax.annotation.Nullable</span>;
<span style="color:#000080;font-weight:bold;">import </span>javax.security.auth.Subject;
<span style="color:#000080;font-weight:bold;">import </span>java.util.Optional;

<span style="color:#808080;font-style:italic;">
</span><span style="color:#000080;font-weight:bold;">public class </span>ValidateUsernamePasswordAgainstUCM <span style="color:#000080;font-weight:bold;">extends </span>AbstractUsernamePasswordValidationAction {

    <span style="color:#000080;font-weight:bold;">private final </span>Logger <span style="color:#660e7a;font-weight:bold;">log </span>= LoggerFactory.<span style="font-style:italic;">getLogger</span>(ValidateUsernamePasswordAgainstUCM.<span style="color:#000080;font-weight:bold;">class</span>);

    <span style="color:#000080;font-weight:bold;">private </span>AuthenticationManager <span style="color:#660e7a;font-weight:bold;">authenticationManager</span>;

    <span style="color:#808080;font-style:italic;">/** {</span><span style="color:#808080;font-weight:bold;font-style:italic;">@inheritDoc</span><span style="color:#808080;font-style:italic;">} */
</span><span style="color:#808080;font-style:italic;">    </span><span style="color:#808000;">@Override
</span><span style="color:#808000;">    </span><span style="color:#000080;font-weight:bold;">protected void </span>doExecute(<span style="color:#000080;font-weight:bold;">final </span>ProfileRequestContext profileRequestContext,
                             <span style="color:#000080;font-weight:bold;">final </span>AuthenticationContext authenticationContext) {
        <span style="color:#000080;font-weight:bold;">try </span>{
            <span style="color:#660e7a;font-weight:bold;">log</span>.debug(<span style="color:#008000;font-weight:bold;">"{} Attempting to authenticate user {}"</span>, getLogPrefix(), getUsernamePasswordContext()
                    .getUsername());

            <span style="color:#000080;font-weight:bold;">if </span>( <span style="color:#660e7a;font-weight:bold;">authenticationManager </span>== <span style="color:#000080;font-weight:bold;">null </span>) {
                error(profileRequestContext, authenticationContext, <span style="color:#008000;font-weight:bold;">"n/a"</span>, <span style="color:#008000;font-weight:bold;">"Invalid Authentication Manager!"</span>, AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">ACCOUNT_ERROR </span>);
                <span style="color:#000080;font-weight:bold;">return</span>;
            }

            <span style="color:#000080;font-weight:bold;">final </span>VelocityContext context = <span style="color:#000080;font-weight:bold;">new </span>VelocityContext();
            context.put(<span style="color:#008000;font-weight:bold;">"usernamePasswordContext"</span>, getUsernamePasswordContext());
            <span style="color:#000080;font-weight:bold;">final </span>String username = getUsernamePasswordContext().getUsername();
            <span style="color:#000080;font-weight:bold;">final </span>String password = getUsernamePasswordContext().getPassword();

            <span style="color:#660e7a;font-weight:bold;">log</span>.trace(<span style="color:#008000;font-weight:bold;">"{} Authentication started for {}"</span>, getLogPrefix(), username);
            <span style="color:#000080;font-weight:bold;">final </span>Optional<User> maybeUser = <span style="color:#660e7a;font-weight:bold;">authenticationManager</span>.attemptLogin(<span style="color:#000080;font-weight:bold;">new </span>PasswordAuthMethod(username, password), <span style="color:#008000;font-weight:bold;">"1.1.1.1"</span>, <span style="color:#008000;font-weight:bold;">""</span>);
            <span style="color:#000080;font-weight:bold;">if </span>( maybeUser.isPresent() ) {
                <span style="color:#000080;font-weight:bold;">final </span>User user = maybeUser.orElse(<span style="color:#000080;font-weight:bold;">null</span>);

                <span style="color:#660e7a;font-weight:bold;">log</span>.info(<span style="color:#008000;font-weight:bold;">"User found: " </span>+ username);
                <span style="color:#000080;font-weight:bold;">if </span>(! user.isActivated()) {
                    <span style="color:#660e7a;font-weight:bold;">log</span>.warn(<span style="color:#008000;font-weight:bold;">"User {} is not yet activated!"</span>, username);
                    error(profileRequestContext, authenticationContext, username, <span style="color:#008000;font-weight:bold;">"Account has not been verified!"</span>, AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">ACCOUNT_ERROR </span>);
                    <span style="color:#000080;font-weight:bold;">return</span>;
                }

                <span style="color:#000080;font-weight:bold;">if </span>(!user.isEnabled()) {
                    <span style="color:#660e7a;font-weight:bold;">log</span>.warn(<span style="color:#008000;font-weight:bold;">"User {} is not enabled!"</span>, username);
                    error(profileRequestContext, authenticationContext, username, <span style="color:#008000;font-weight:bold;">"Account is disabled!"</span>, AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">ACCOUNT_ERROR </span>);
                    <span style="color:#000080;font-weight:bold;">return</span>;
                }

                <span style="color:#000080;font-weight:bold;">if </span>( ! (user <span style="color:#000080;font-weight:bold;">instanceof </span>GuardianUser) ) {
                    <span style="color:#660e7a;font-weight:bold;">log</span>.warn(<span style="color:#008000;font-weight:bold;">"User {} is not a guardian!"</span>, username);
                    error(profileRequestContext, authenticationContext, username, <span style="color:#008000;font-weight:bold;">"Incorrect account type!"</span>, AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">ACCOUNT_ERROR </span>);
                    <span style="color:#000080;font-weight:bold;">return</span>;
                }

                authenticationContext.getSubcontext(UcmResponseContext.<span style="color:#000080;font-weight:bold;">class</span>, <span style="color:#000080;font-weight:bold;">true</span>)
                        .successful(user);

                buildAuthenticationResult(profileRequestContext, authenticationContext);

            } <span style="color:#000080;font-weight:bold;">else </span>{
                <span style="color:#660e7a;font-weight:bold;">log</span>.info(<span style="color:#008000;font-weight:bold;">"{} Login by '{}' failed"</span>, getLogPrefix(), getUsernamePasswordContext().getUsername());

                error(profileRequestContext, authenticationContext, username, <span style="color:#008000;font-weight:bold;">"Authentication failed!"</span>, AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">INVALID_CREDENTIALS </span>);
            }
        } <span style="color:#000080;font-weight:bold;">catch </span>(<span style="color:#000080;font-weight:bold;">final </span>Exception e) {
            <span style="color:#660e7a;font-weight:bold;">log</span>.warn(<span style="color:#008000;font-weight:bold;">"{} Login by {} produced exception"</span>, getLogPrefix(), getUsernamePasswordContext().getUsername(), e);
            error(profileRequestContext, authenticationContext, <span style="color:#008000;font-weight:bold;">"n/a"</span>, e.getMessage(), AuthnEventIds.<span style="color:#660e7a;font-weight:bold;font-style:italic;">AUTHN_EXCEPTION </span>);
        }
    }

    <span style="color:#000080;font-weight:bold;">protected void </span>error(<span style="color:#000080;font-weight:bold;">final </span>ProfileRequestContext profileRequestContext,
                               <span style="color:#000080;font-weight:bold;">final </span>AuthenticationContext authenticationContext,
                               String username,
                               String message,
                               String eventId ) {

        <span style="color:#000080;font-weight:bold;">if </span>( profileRequestContext != <span style="color:#000080;font-weight:bold;">null </span>&& authenticationContext != <span style="color:#000080;font-weight:bold;">null  </span>&& message != <span style="color:#000080;font-weight:bold;">null </span>&& eventId != <span style="color:#000080;font-weight:bold;">null </span>) {
            authenticationContext.getSubcontext(UcmResponseContext.<span style="color:#000080;font-weight:bold;">class</span>, <span style="color:#000080;font-weight:bold;">true</span>).failed(message);
            handleError(profileRequestContext, authenticationContext, message, eventId);
            <span style="color:#660e7a;font-weight:bold;">log</span>.warn(<span style="color:#008000;font-weight:bold;">"Login Failed: [{}] {} - {}"</span>, username, message, eventId);
        }
    }


    <span style="color:#000080;font-weight:bold;">public </span>AuthenticationManager getAuthenticationManager() {
        <span style="color:#000080;font-weight:bold;">return </span><span style="color:#660e7a;font-weight:bold;">authenticationManager</span>;
    }

    <span style="color:#000080;font-weight:bold;">public void </span>setAuthenticationManager(AuthenticationManager authenticationManager) {
        <span style="color:#000080;font-weight:bold;">this</span>.<span style="color:#660e7a;font-weight:bold;">authenticationManager </span>= authenticationManager;
    }
}

Is there any thing obvious that I am doing wrong that is causing...

2016-09-26 07:08:35,798 - ERROR [net.shibboleth.idp.authn.impl.SelectSubjectCanonicalizationFlow:78] - Profile Action SelectSubjectCanonicalizationFlow: No potential flows left to choose from, canonicalization will fail

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>