Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Kerberos ticket validation - GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Kerberos ticket validation - GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)

    I am a seasoned c# developer have have worked with Java here and there it is fairly similar in many respects. I am struggling to get something that is very simple to do in .net in java ans that is validate a kerberos ticket. i have some simple code that generates a ticket after asking for a username and password and the ticket generation works. I want to then pass this to a server to validate the user coming in but i get the following error:


    Exception in thread "main" GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)
    at sun.security.jgss.GSSHeader.<init>(GSSHeader.java: 97)
    at sun.security.jgss.GSSContextImpl.acceptSecContext( GSSContextImpl.java:306)
    at sun.security.jgss.GSSContextImpl.acceptSecContext( GSSContextImpl.java:285)
    at com.company.KerberosTicketRetriever.retrieveTicket (KerberosTicketRetriever.java:194)
    at com.company.Main.main(Main.java:28)

    On doing research it looks to be like i might need an SPN (service principal name) for the server which i can do but i don't know what the service name is that i need to register that for. I have an Apache Ignite server that i have written a java plugin for that authenticates and authorizes users. The plumbing for that is all working and now i need to get the kerberos validation working but have this issue. If i have to create an SPN what would the service be or can that be anything i make up like "Ignite" for example.


    Lastly, does anyone know if there is an easier way to do a single signon or kerberos authentication. I tried waffle and spnego but that seems to be for web clients.

    thanks Wayne

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Kerberos ticket validation - GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)

    This is a very specific question about using some product. Is there a forum for it?
    I don't know if anyone here has knowledge about that product.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Kerberos ticket validation - GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)

    its just java code i have the source code for it. All i am trying to do is authenticate kerberos from a client to a service

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Kerberos ticket validation - GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)

    Exception in thread "main" GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)
    What did the API doc say about the exception that was thrown?

    Your description of the problem is a lot of jargon that has no meaning for me.
    Can you break the problem down into a question using java programming terms?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 2
    Last Post: September 28th, 2013, 07:36 PM
  2. Replies: 1
    Last Post: August 9th, 2013, 10:26 AM
  3. Replies: 3
    Last Post: November 26th, 2012, 09:01 AM
  4. Syntax error on token ";", { expected after this token please HELP
    By Creeper in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 1st, 2012, 03:12 PM

Tags for this Thread