Reputation: 321
I have the following scenario: I have a server that runs inside an Oracle database (with Java SE 6) that connects to a web service, using the Apache HTTP client (in Java). The web service needs to be protected using Kerberos, i.e. with SPNEGO authentication.
My server has a Kerberos principal, with a random key exported to a keytab, and then imported into a database table. So I have a KerberosPrincipal with a number of associated KerberosKey objects (one for each encryption method), all that information I have collected in a Subject.
I expect that the next step is to contact the KDC in order to get the TGT and store it in the Subject. How do I do that? All the documentation I have found on this assumes that this happens in a login module, but there is no login in my scenario. Or will one of the below call the KDC for me?
Now i need to call GSSManager.createCredential to create a GSSCredential which I can wrap into a KerberosCredentials and a BasicCredentialsProvider that I can add to the HttpClientContext, so the HttpClient can do the SPNEGO authentication.
But how do I get info in my Subject into the GSSCredential?
Upvotes: 1
Views: 2192
Reputation: 321
After digging around the web for about a week, I finally found the answer here. Snippet from that doc:
Upvotes: 3