final String text = inputCallback.getText(); if (text == null) { final String defaultText = inputCallback.getDefaultText();
@Override public boolean identify(final Subject subject) throws LoginException { if (restSessionManager == null) { return false; } boolean result = false; final String token = restTokenCB.getText(); final String remoteAddr = remoteAddrCB.getText(); if (token != null && remoteAddr != null) { final Subject s = restSessionManager.authenticate(token, remoteAddr); if (s != null) { result = true; updateFromSubject(subject, s); logger.log(PROGRESS_LEVEL, "Detected ReST token"); } } return result; } }
private String getCatalinaBase() { // Have to get this via a callback as that is the only link we have back // to the defining Realm. Can't use the system property as that may not // be set/correct in an embedded scenario if (callbackHandler == null) { return null; } Callback callbacks[] = new Callback[1]; callbacks[0] = new TextInputCallback("catalinaBase"); String result = null; try { callbackHandler.handle(callbacks); result = ((TextInputCallback) callbacks[0]).getText(); } catch (IOException | UnsupportedCallbackException e) { return null; } return result; } }
private String getCatalinaBase() { // Have to get this via a callback as that is the only link we have back // to the defining Realm. Can't use the system property as that may not // be set/correct in an embedded scenario if (callbackHandler == null) { return null; } Callback callbacks[] = new Callback[1]; callbacks[0] = new TextInputCallback("catalinaBase"); String result = null; try { callbackHandler.handle(callbacks); result = ((TextInputCallback) callbacks[0]).getText(); } catch (IOException | UnsupportedCallbackException e) { return null; } return result; } }
@Override public boolean identify(Subject subject) throws LoginException { if (secureAdmin == null) { return false; } final String providedIndicator = textCB.getText(); final SpecialAdminIndicatorChecker checker = new SpecialAdminIndicatorChecker( providedIndicator, secureAdmin.getSpecialAdminIndicator(), remoteHostAuth.textCB.getText()); if (checker.result() == SpecialAdminIndicatorChecker.Result.MISMATCHED) { throw new LoginException(); } /* * Either there was no special indicator or there was one and * it matched what we expect. */ if (checker.result() == SpecialAdminIndicatorChecker.Result.MATCHED) { /* * Add a principal indicating that this subject represents * another server in the domain and so we * can trust it completely, even if the request is remote and secure * admin is disabled. */ subject.getPrincipals().add(new AdminIndicatorPrincipal(providedIndicator)); return true; } return false; } }
@Override public boolean identify(Subject subject) throws LoginException { if (authTokenManager == null) { return false; } Subject s = null; final String token = textCB.getText(); if (token != null) { s = authTokenManager.findToken(token); if (s != null) { /* * The token manager knows which Subject was effective when the token * was created. We add those to the lists we'll add if this module's * commit is invoked. */ logger.log(PROGRESS_LEVEL, "Recognized valid limited-use token"); updateFromSubject(subject, s); /* * Add an additional principal indicating that we trust this * subject to make remote requests. Otherwise we would * reject attempts to use a token from off-node, and that's * partly the whole point of tokens. */ subject.getPrincipals().add(new AdminTokenPrincipal(token)); } } return s != null; } }
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException | UnsupportedCallbackException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException e) { throw new LoginException(e.toString());
password = new String(((PasswordCallback) callbacks[1]).getPassword()); nonce = ((TextInputCallback) callbacks[2]).getText(); nc = ((TextInputCallback) callbacks[3]).getText(); cnonce = ((TextInputCallback) callbacks[4]).getText(); qop = ((TextInputCallback) callbacks[5]).getText(); realmName = ((TextInputCallback) callbacks[6]).getText(); md5a2 = ((TextInputCallback) callbacks[7]).getText(); authMethod = ((TextInputCallback) callbacks[8]).getText(); } catch (IOException | UnsupportedCallbackException e) { throw new LoginException(sm.getString("jaasMemoryLoginModule.callbackHandlerError", e.toString()));
final TextInputCallback tic = new TextInputCallback("authMethod"); callbackHandler.handle(new Callback[] { tic }); authMethod = tic.getText();
final String text = inputCallback.getText(); if (text == null) { final String defaultText = inputCallback.getDefaultText();
final String text = inputCallback.getText(); if (text == null) { final String defaultText = inputCallback.getDefaultText();
final String text = inputCallback.getText(); if (text == null) { final String defaultText = inputCallback.getDefaultText();