Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 689075 Details for
Bug 905128
[CRASH] OpenJDK-1.7.0 while using NSS security provider and kerberos
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
GSSAPITest.java
GSSAPITest.java (text/x-java), 1.75 KB, created by
Alon Bar-Lev
on 2013-01-28 16:31:50 UTC
(
hide
)
Description:
GSSAPITest.java
Filename:
MIME Type:
Creator:
Alon Bar-Lev
Created:
2013-01-28 16:31:50 UTC
Size:
1.75 KB
patch
obsolete
>import java.io.IOException; >import java.security.PrivilegedAction; >import javax.naming.NamingException; >import javax.naming.directory.SearchControls; >import javax.security.auth.Subject; >import javax.security.auth.callback.Callback; >import javax.security.auth.callback.CallbackHandler; >import javax.security.auth.callback.NameCallback; >import javax.security.auth.callback.PasswordCallback; >import javax.security.auth.callback.UnsupportedCallbackException; >import javax.security.auth.login.LoginContext; >import javax.security.auth.login.LoginException; > >public class GSSAPITest { > > public static Subject login( > final String username, > final String password, > final String realm > ) throws LoginException { > LoginContext lc = new LoginContext( > GSSAPITest.class.getSimpleName(), > new CallbackHandler() { > @Override > public void handle(Callback[] callbacks) > throws IOException, UnsupportedCallbackException { > String principalName; > if (username.contains("@")) { > principalName = username; > } else { > principalName = String.format("%s@%s", username, realm.toUpperCase()); > } > for (Callback cb : callbacks) { > if (cb instanceof NameCallback) { > ((NameCallback)cb).setName(principalName); > } > else if (cb instanceof PasswordCallback) { > ((PasswordCallback)cb).setPassword(password.toCharArray()); > } > else { > throw new UnsupportedCallbackException(cb); > } > } > } > } > ); > lc.login(); > return lc.getSubject(); > } > > public static void main(String[] args) throws Exception { > System.setProperty("java.security.krb5.conf", "./krb5.conf"); > System.setProperty("java.security.auth.login.config", "./jaas.conf"); > > Subject subject1 = login("vdcadmin", "123456", "QA.LAB.TLV.REDHAT.COM"); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 905128
: 689075 |
689076
|
689077
|
689096
|
689985
|
691121