@Override public void handle(final Callback callbacks[]) throws IOException, UnsupportedCallbackException { for (final Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback.class.cast(callback).setName(username); } else if (callback instanceof TextInputCallback) { final TextInputCallback cb = TextInputCallback.class.cast(callback); if (cb.getPrompt().equals("authMethod")) { cb.setText(HttpServletRequest.CLIENT_CERT_AUTH); } else { throw new UnsupportedCallbackException(callback); } } else { throw new UnsupportedCallbackException(callback); } } } }
@Override public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (final Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback.class.cast(callback).setName(username); } else if (callback instanceof TextInputCallback) { final TextInputCallback cb = TextInputCallback.class.cast(callback); if (cb.getPrompt().equals("authMethod")) { cb.setText(authenticationMethod); } else if (cb.getPrompt().equals("algorithm")) { cb.setText(algorithm); } else if (cb.getPrompt().equals("signature")) { cb.setText(clientSignature); } else { throw new UnsupportedCallbackException(callback); } } else { throw new UnsupportedCallbackException(callback); } } } });
} else if (callback instanceof TextInputCallback) { final TextInputCallback cb = TextInputCallback.class.cast(callback); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(HttpServletRequest.DIGEST_AUTH); } else {
@Override public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (final Callback cb : callbacks) { if (cb instanceof TextInputCallback) { final TextInputCallback ticb = (TextInputCallback)cb; final String prompt = ticb.getPrompt(); log.info("Got prompt: {}", prompt); if (prompt == "clientID") { ticb.setText(clientID); } else if (prompt == "clientSecret") { ticb.setText(clientSecret); } else if (prompt == "accessToken") { ticb.setText(accessToken); } else if (prompt == "refreshToken") { ticb.setText(refreshToken); } else { throw new UnsupportedCallbackException(ticb, "Unrecognized prompt: " + ticb.getPrompt()); } } else { throw new UnsupportedCallbackException(cb, "Unsupported callback type."); } } }
} else if (callback instanceof TextInputCallback) { TextInputCallback tic = (TextInputCallback) callback; System.out.println(tic.getPrompt()); System.out.flush(); tic.setText((new BufferedReader(new InputStreamReader(System.in)))
} else if (callback instanceof TextInputCallback) { TextInputCallback tic = (TextInputCallback) callback; System.out.println(tic.getPrompt()); System.out.flush(); tic.setText((new BufferedReader(new InputStreamReader(System.in)))
} else if (callback instanceof TextInputCallback) { TextInputCallback tic = (TextInputCallback) callback; System.out.println(tic.getPrompt()); System.out.flush(); tic.setText((new BufferedReader(new InputStreamReader(System.in)))
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else if (cb.getPrompt().equals("catalinaBase")) { cb.setText(realm.getContainer().getCatalinaBase().getAbsolutePath()); } else {
} else if (callbacks[i] instanceof TextInputCallback) { TextInputCallback cb = ((TextInputCallback) callbacks[i]); if (cb.getPrompt().equals("nonce")) { cb.setText(nonce); } else if (cb.getPrompt().equals("nc")) { cb.setText(nc); } else if (cb.getPrompt().equals("cnonce")) { cb.setText(cnonce); } else if (cb.getPrompt().equals("qop")) { cb.setText(qop); } else if (cb.getPrompt().equals("realmName")) { cb.setText(realmName); } else if (cb.getPrompt().equals("md5a2")) { cb.setText(md5a2); } else if (cb.getPrompt().equals("authMethod")) { cb.setText(authMethod); } else if (cb.getPrompt().equals("catalinaBase")) { cb.setText(realm.getContainer().getCatalinaBase().getAbsolutePath()); } else {
} else if (callback instanceof TextInputCallback) { final TextInputCallback tic = (TextInputCallback) callback; System.out.println(tic.getPrompt()); System.out.flush(); tic.setText(getLineContent());
} else if (callback instanceof TextInputCallback) { final TextInputCallback tic = (TextInputCallback) callback; System.out.println(tic.getPrompt()); System.out.flush(); tic.setText(getLineContent());
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (Callback cb : callbacks) { if (cb instanceof NameCallback) { ((NameCallback) cb).setName(passwordAuthentication.getUserName()); } else if (cb instanceof PasswordCallback) { ((PasswordCallback) cb).setPassword(passwordAuthentication.getPassword()); } else if (cb instanceof TextInputCallback) { final TextInputCallback ticb = (TextInputCallback) cb; final String prompt = ticb.getPrompt(); if (AuthenticatorType.ADMIN_INDICATOR.name().equals(prompt)) { ticb.setText(specialAdminIndicator()); } else if (AuthenticatorType.ADMIN_TOKEN.name().equals(prompt)) { ticb.setText(token()); } else if (AuthenticatorType.REMOTE_HOST.name().equals(prompt)) { ticb.setText(remoteHost()); } else if (AuthenticatorType.REST_TOKEN.name().equals(prompt)) { ticb.setText(restToken()); } else if (AuthenticatorType.REMOTE_ADDR.name().equals(prompt)) { ticb.setText(remoteAddr()); } } else if (cb instanceof AdminLoginModule.PrincipalCallback) { ((AdminLoginModule.PrincipalCallback) cb).setPrincipal(clientPrincipal); } } }
TextInputCallback call = (TextInputCallback)callbacks[i]; label = new Label(shell,SWT.NONE); label.setText(call.getPrompt()); control = new Text(shell,SWT.BORDER); if(call.getDefaultText()!=null) {
TextInputCallback call = (TextInputCallback)callbacks[i]; label = new Label(shell,SWT.NONE); label.setText(call.getPrompt()); control = new Text(shell,SWT.BORDER); if(call.getDefaultText()!=null) {