-Can you clarify what you mean by "you don't want to authenticate"?:
I meant that the user is already signed on and already authenticated when he logged into his computer.
-Use case:
>user logs into his/her machine.
>Ajax will pass the request object with the api.
>the '/user' api will call 'principaluser = request.getUserPrincipal().getName();' <==== [works great as long as the Jersey api and the UI app are deployed on the same server].
>using the principal name, I get his/her credentials from LDAP and pass it back to the UI.
-log from a working example (same domain):
12:36:41.706 [http-nio-8080-exec-8] DEBUG w.servlet.NegotiateSecurityFilter - GET /ServiceCloud/ldap/user, contentlength: -1
12:36:41.706 [http-nio-8080-exec-8] DEBUG w.s.s.NegotiateSecurityFilterProvider - authorization: <none>, ntlm post: false
12:36:41.706 [http-nio-8080-exec-8] DEBUG w.servlet.NegotiateSecurityFilter - previously authenticated Windows user: SOC\zguler
12:36:41.710 [http-nio-8080-exec-8] INFO com.ssc.service.ServiceCloudResource - principaluser: SOC\zguler
12:36:41.710 [http-nio-8080-exec-8] INFO com.ssc.service.ServiceCloudResource - accountName: zguler
I am in filter: CorsResponseFilter
12:37:21.353 [http-nio-8080-exec-3] DEBUG w.servlet.NegotiateSecurityFilter - GET /ServiceCloud/ldap/user, contentlength: -1
12:37:21.353 [http-nio-8080-exec-3] DEBUG w.servlet.NegotiateSecurityFilter - authorization required
12:38:37.132 [http-nio-8080-exec-2] DEBUG w.servlet.NegotiateSecurityFilter - GET /ServiceCloud/ldap/user, contentlength: -1
12:38:37.133 [http-nio-8080-exec-2] DEBUG w.s.s.NegotiateSecurityFilterProvider - authorization: <none>, ntlm post: false
12:38:37.133 [http-nio-8080-exec-2] DEBUG w.servlet.NegotiateSecurityFilter - previously authenticated Windows user: SOC\zguler
12:38:37.137 [http-nio-8080-exec-2] INFO com.ssc.service.ServiceCloudResource - principaluser: SOC\zguler
12:38:37.137 [http-nio-8080-exec-2] INFO com.ssc.service.ServiceCloudResource - accountName: zguler
I am in filter: CorsResponseFilter
-log from a failed example (api in a defferent domain than the UI app):
13:06:20.927 [http-nio-8080-exec-4] DEBUG w.servlet.NegotiateSecurityFilter - GET /ServiceCloud/ldap/user, contentlength: -1
13:06:20.927 [http-nio-8080-exec-4] DEBUG w.servlet.NegotiateSecurityFilter - authorization required
-regrading the use of NTLM.js:
this may not work for my use case. it looks like I need to provide the user credentials again before I do the AJAX call:
Ntlm.setCredentials('domain', 'username', 'password');
the main reason I elected to use Waffle is to be able to get the principal name without having the user log in again.
I hope this makes sense. it seems that the issue is if Waffle can handle CORS !!! I hope there is a solution for this.
thanx,
-Zak