添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
打酱油的槟榔  ·  .NET ...·  1 月前    · 
傻傻的双杠  ·  Compiling XLA with ...·  1 月前    · 
傲视众生的开水瓶  ·  Git Blame Info - ...·  3 周前    · 
坏坏的甜瓜  ·  SQLFetchScroll ...·  2 周前    · 
刚分手的红薯  ·  Yocto/Mender: ...·  2 天前    · 
愉快的包子  ·  PHP: pg_num_rows - Manual·  2 月前    · 
不开心的盒饭  ·  JavaScript ...·  3 月前    · 
爱旅游的小虾米  ·  R3/drei difference in ...·  4 月前    · 

We have established the SSO between Hybris C4C and Hybris commerce (ASM) with MS-ADFS as IDP. The entire flow works fine.

There is a specific use case where if in any case, the C4C agent does not have permissions to access the ASM as an asagent, they must be redirected to the homepage with asm component active so that they may try to access the ASM separately.

Due to the best practice constraints, we are not changing the samlsinglesignon RedirectionController , but I have written my own controller.

To redirect to the new controller, I have injected the following property in the spring-security-config.xml

 <bean id="successRedirectHandler"
       class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler">
     <property name="defaultTargetUrl" value="https://domain/sso/adfs"/>
 </bean>

The issue is, after successful authentication from IDP, whenever the call is getting redirected to the new controller, there is a null pointer exception - The authentication attributes are null.

 INFO   | jvm 1    | main    | 2018/08/23 15:05:29.654 | 
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.781 | INFO  [ajp-bio-8009-exec-2] [SAMLProtocolMessageXMLSignatureSecurityPolicyRule] SAML protocol message was not signed, skipping XML signature processing
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.881 | INFO  [ajp-bio-8009-exec-2] [10.149.252.34] [ADFSRedirectionController] Inside the ADFSRedirectionController
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 | INFO  [ajp-bio-8009-exec-2] [10.149.252.34] [ADFSRedirectionController] SecurityContextHolder.getContext():org.springframework.security.core.context.SecurityContextImpl@ffffffff: Null authentication
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 | INFO  [ajp-bio-8009-exec-2] [10.149.252.34] [ADFSRedirectionController] SecurityContextHolder.getContext().getAuthentication():null
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 | Aug 23, 2018 3:05:48 PM org.apache.catalina.core.StandardWrapperValve invoke
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 | SEVERE: Servlet.service() for servlet [sso] in context with path [/sso] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 | java.lang.NullPointerException
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at idp.ssotraining.ADFSRedirectionController.redirect(ADFSRedirectionController.java:61)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at java.lang.reflect.Method.invoke(Method.java:497)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
 INFO   | jvm 1    | main    | 2018/08/23 15:05:48.882 |     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

I am not able to understand that if I redirect to the original controller, then the authentication is not null, but if I redirect to the new controller, the authentication is not present.

I am sure I am missing something. Any help in this regard would greatly be appreciated.

Streamlining Document Management: DocuSign and SAP Sales Cloud V2 Integration via BTP in CRM and CX Blogs by Members Utilizing SAP BTP Integration Suite for Integration with SAP Sales and Service Cloud V2 in CRM and CX Blogs by SAP Hybris user not authenticated after SAML successful round trip in CRM and CX Questions Sales Cloud CRM Odata Auth Error Integration in CRM and CX Questions Creating your Local PPS Box with SAP CARAB in CRM and CX Blogs by SAP