Skip to content

How to pass values into UsernameTokenPasswordClientCallback #326

Answered by shumonsharif
arolfes asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @arolfes What you put together is one way to do it. I think a slightly cleaner approach may be to:

  • Mark your UsernameTokenPasswordClientCallback class with @Singleton and @Startup - this will make it a CDI bean that gets initialized at startup, and this will also allow you to inject config values in the class.
  • Inject an instance of your new bean, and use PW_CALLBACK_REF instead of PW_CALLBACK_CLASS:
        @Inject
        UsernameTokenPasswordClientCallback utpcc;
        outProps.put(ConfigurationConstants.PW_CALLBACK_REF, utpcc);

I did not test this, but I believe it should work - let us know in case you have try it and have some success.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arolfes
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@arolfes
Comment options

@gituharish
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants