Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error logging in user: com.sun.jna.platform.win32.Win32Exception: The token supplied to the function is invalid #452

Closed
rboughani opened this issue Dec 16, 2016 · 12 comments

Comments

@rboughani
Copy link

rboughani commented Dec 16, 2016

I try to do a SSO authentication using WAFFLE, but i have this error

L: waffle.spring.NegotiateSecurityFilter] - [M: error logging in user: com.sun.jna.platform.win32.Win32Exception: The token supplied to the function is invalid

complete error log in image here :
http:https://imgur.com/a/2KWnq

@dblock
Copy link
Collaborator

dblock commented Dec 16, 2016

@dblock dblock closed this as completed Dec 16, 2016
@rboughani
Copy link
Author

rboughani commented Dec 16, 2016

Troubleshooting Kerberos delegation link not work, i have found this link

Troubleshooting Kerberos delegation for Monitoring Server
https://technet.microsoft.com/en-us/library/dd285465(v=office.12).aspx

@rboughani
Copy link
Author

rboughani commented Dec 16, 2016

And i havn't well understand the situation,
so i can't teste my application in my developer machine ? i muste deploy my application in server to be work correctly ?
can you please more explain me

@hazendaz
Copy link
Member

Are you running off current master or 1.8.1? There are some issues on 1.8.1 that might be causing your problem. The latest master is much better at handling issues. You can run on developer machine. In fact, that is the only way I get to use waffle myself as we have linux and as such developer machine is all that will work (ie windows).

@rboughani
Copy link
Author

rboughani commented Dec 19, 2016

Yes i use the 1.8.1 version,
I have configured just Spring sécurity side, i must configure the Tomcat server too, or i should just to add WAFFLE jar to tomcat lib ??
i'll try tomorow with WAFFLE 1.6 and take you knew with result

@rboughani
Copy link
Author

rboughani commented Dec 19, 2016

i have the same error with waffle 1.7.5 version,
and with 1.6 i have this problem

 L: waffle.spring.NegotiateSecurityFilter] - [M: error logging in user: The token supplied to the function is invalid] , 

the same error at last except this text

 com.sun.jna.platform.win32.Win32Exception:


 L: io.oasp.module.logging.common.impl.PerformanceLogFilter] - [M: http:https://localhost:8080/suivireco-server/;0;500;java.lang.RuntimeException;Invalid Authorization header: Negotiate]

And i noticed that the port in the fllow line change evry execution

  [L: waffle.servlet.spi.NegotiateSecurityFilterProvider] - [M: security package: Negotiate, connection id: 0:0:0:0:0:0:0:1:64067]

I have try with Troubleshooting, https://github.com/Waffle/waffle/blob/master/Docs/Troubleshooting.md.
but the problem still exist

@dblock
Copy link
Collaborator

dblock commented Dec 19, 2016

I think everyone is chasing a red herring wrt version. Kerberos on the local machine should work when you access it by name, I believe you still need an SPN, too. I could be wrong, but I don't believe you can do it with http:https://localhost.

@rboughani
Copy link
Author

rboughani commented Dec 19, 2016

I think that have link with that

Kerberos (the basis for integrated Windows authentication) requires careful configuration. If the steps in this guide are followed exactly, then a working configuration will result. It is important that the steps below are followed exactly. There is very little scope for flexibility in the configuration. From the testing to date it is known that:

The host name used to access the Tomcat server must match the host name in the SPN exactly else authentication will fail. A checksum error may be reported in the debug logs in this case.

http:https://tomcat.apache.org/tomcat-8.0-doc/windows-auth-howto.html

at my client they use two different domain, one with netbiios SAM, and another with @cc.fr

@rboughani
Copy link
Author

rboughani commented Dec 19, 2016

When i try to excute this line command, that return me "account http:https://localhost not found"

  setspn -L http:https://localhost

And when i want to create an new spn for my machine that return me that i have not access
Insufficient access right for the account........

  setspn -A HTTP/localhost:8080 rboughani

@dblock
Copy link
Collaborator

dblock commented Dec 19, 2016

Localhost is not something that's known to your domain controller. So I think this has to be a fully qualified name of your machine on the domain that it is joined to.

@rboughani
Copy link
Author

i have see with the network admins, and they say me that Kerberos system need an SPN and services account, and they will create me one,
i let you knew if they work

@AniWar
Copy link

AniWar commented Mar 12, 2020

I'm experiencing this as well (Trying with Java+ glassfish4 ), can someone please point out what was the correct solution to this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants