Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8481539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:35:01+00:00 2026-06-10T19:35:01+00:00

I am using Krb5LoginModule in one of the POC. I have provided useDefaultCache=true and

  • 0

I am using Krb5LoginModule in one of the POC. I have provided useDefaultCache=true and renewTGT=true.

The code throws an exception when the ticket is expired although I have mentioned renewTGT=true. I have set up allowtgtsessionkey value to 1 in windows registry (I am running XP SP2). The KDC (ActiveDirectory) settings are default. Ticket lifetime = 10 hours and renewal request threshold = 7 days.

Source Code

import java.util.HashMap;
import java.util.Map;
import javax.security.auth.Subject;
import com.sun.security.auth.module.Krb5LoginModule;

public class Temp3 {
    public static void main(String[] args) throws Exception {
        System.setProperty("sun.security.krb5.debug", "true");

        Subject subject = new Subject();

        Krb5LoginModule krb5 = new Krb5LoginModule();

        Map <String, String> map = new HashMap <String, String>();
        map.put("useTicketCache", "true");
        map.put("doNotPrompt", "true");
        map.put("renewTGT", "true");
        map.put("debug", "true");

        krb5.initialize(subject, null, null, map);
        krb5.login();
        krb5.commit();
        System.out.println(subject);
    }
}

The code works fine when the ticket is not expired i.e the time I ran kinit within 10 hours of running the code above.

I wrote this POC because I have to run JDBC based applications using SQL Server driver (version 4.0). I don’t want long running services to fail during the database reconnect attempts which might occur due to factors such as network glitch resulting in broken pipe.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:35:02+00:00Added an answer on June 10, 2026 at 7:35 pm

    You are going the wrong way. Fist of all you should use LoginContext to obtain credentials and not interact with Kerberos 5 directly. Second, non-human access needs a keytab. This is equivalent to a TGT. Export a Keytab for your server and modify the Krb5LoginModule configration. This tutorial will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public
using this code I can send one texture to the shader: devcon->PSSetShaderResources(0, 1, &pTexture);
Using callbacks, I have the following code var TK = { List: [], getSectionA:
Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [
Using System.Diagnostics.EventLog .NET type one can programmatically create logs into the Event Viewer application.
Using SolrNet for querying & faceting. I have a combination of int, tdate and
using MSQL 2005 I have a continuous set of flow measurements (averaged for each
Using this code, the following execution yields strange results: C 100 R W The
Using Subsonic 3 I have the fields: o CreatedOn (datetime) o CreatedBy (nvarchar(50)) o
Using Android NDK is it possible (from native C-code) to get a list of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.