authentication - Unable to Login to Hybris Mobile iOS B2B Application -


i unable login hybris mobile app sdk ios. using default b2b sample application provided hybris in ios sdk.

i have setup hybris platform on machine , have set ip address, port , username environments.plist file. default username b2b mark.rivers@pronto-hw.com , password: 12341234

below error:

2016-09-07 18:19:45:445 yb2bapp[20152:70b] login button pressed ...

2016-09-07 18:19:47.197 yb2bapp[20152:291779] retrieving first time token user mark.rivers@pronto-hw.com

2016-09-07 18:19:47:198 yb2bapp[20152:70b] injectauthorizationheader basic bwfyay5yaxzlcnnachjvbnrvlwh3lmnvbtoxmjm0mtizna==

2016-09-07 18:19:47:198 yb2bapp[20152:70b] url https://:9002/authorizationserver/oauth/token 2016-09-07 18:19:47:198 yb2bapp[20152:70b] params

{ "client_id" = "mobile_android"; "client_secret" = secret; "grant_type" = password; password = 12341234; username = "mark.rivers@pronto-hw.com"; } 

2016-09-07 18:19:47:317 yb2bapp[20152:70b] error during retrieval of token: error domain=com.alamofire.error.serialization.response code=-1011 "request failed: unauthorized (401)" userinfo=0x7b86e6e0

{com.alamofire.serialization.response.error.response= { url: https://:9002/authorizationserver/oauth/token } { status code: 401, headers {

"content-type" = "application/json;charset=utf-8"; date = "wed, 07 sep 2016 12:49:47 gmt"; server = "apache-coyote/1.1"; "transfer-encoding" = identity; "x-frame-options" = sameorigin; 

} }, nserrorfailingurlkey=https://:9002/authorizationserver/oauth/token, nslocalizeddescription=request failed: unauthorized (401), com.alamofire.serialization.response.error.data=<7b0d0a20 20202265 72726f72 7322203a 205b207b 0d0a2020 20202020 226d6573 73616765 22203a20 22556e6b 6e6f776e 20636c69 656e7420 6d6f6269 6c655f61 6e64726f 6964222c 0d0a2020 20202020 22747970 6522203a 2022556e 61757468 6f72697a 65644572 726f7222 0d0a2020 207d205d 0d0a7d>}

2016-09-07 18:19:47:318 yb2bapp[20152:70b] problems during auth token retrieval, reason: request failed: unauthorized (401)

2016-09-07 18:19:47:630 yb2bapp[20152:70b] error retrieved ...

also in code there method applybasicauth adding authorizationheader , basic_auth constant instead based on password. supposed change:

- (void)applybasicauth {     if(self.restengine) {         nsstring *authorizationheader = [nsstring stringwithformat:@"basic %@", basic_auth];         [self.restengine injectauthorizationheader:authorizationheader];     } else {         ddlogerror(@"!!! restengine not set !!!");     } } 

basic_auth is:

#define basic_auth @"bw9iawxlx2fuzhjvawq6c2vjcmv0" 

environments.plist screenshot:

enter image description here

error screenshot:

enter image description here

postman results:

enter image description here

enter image description here

enter image description here

hybris console logs:

error [hybrishttp20] [xx.xxx.xx.xxx] [clientcredentialstokenendpointfilter] internal error occurred while trying authenticate user. org.springframework.security.authentication.internalauthenticationserviceexception: unknown client mobile_ios @ org.springframework.security.authentication.dao.daoauthenticationprovider.retrieveuser(daoauthenticationprovider.java:110) ~[spring-security-core-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.authentication.dao.abstractuserdetailsauthenticationprovider.authenticate(abstractuserdetailsauthenticationprovider.java:132) ~[spring-security-core-3.2.5.release.jar: @ org.springframework.security.authentication.providermanager.authenticate(providermanager.java:156) ~[spring-security-core-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.oauth2.provider.client.clientcredentialstokenendpointfilter.attemptauthentication(clientcredentialstokenendpointfilter.java:123) ~[spring-security-oauth2-2.0.6.release @ org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:211) [spring-security-web-3.2.5.release.jar:3.2.5.releas @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.context.request.async.webasyncmanagerintegrationfilter.dofilterinternal(webasyncmanagerintegrationfilter.java:50) [spring-security-web-3.2.5.release.jar:3.2.5.rele @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.access.channel.channelprocessingfilter.dofilter(channelprocessingfilter.java:144) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.filterchainproxy.dofilterinternal(filterchainproxy.java:192) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:160) [spring-security-web-3.2.5.release.jar:3.2.5.release] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain$internalfilterchain.dofilter(abstractplatformfilterchain.java:224) [coreserver.jar:?] @ de.hybris.platform.webservicescommons.filter.anonymousclientfilter.dofilter(anonymousclientfilter.java:91) [webservicescommonsserver.jar:?] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain$internalfilterchain.dofilter(abstractplatformfilterchain.java:224) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.sessionfilter.dofilter(sessionfilter.java:71) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain$internalfilterchain.dofilter(abstractplatformfilterchain.java:224) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.tenantactivationfilter.dofilter(tenantactivationfilter.java:89) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain$internalfilterchain.dofilter(abstractplatformfilterchain.java:224) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.log4jfilter.dofilter(log4jfilter.java:45) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain$internalfilterchain.dofilter(abstractplatformfilterchain.java:224) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.abstractplatformfilterchain.dofilterinternal(abstractplatformfilterchain.java:154) [coreserver.jar:?] @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:344) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:261) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) [catalina.jar:7.0.59] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) [catalina.jar:7.0.59] @ org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:85) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) [spring-web-4.1.7.release.jar:4.1.7.release] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) [catalina.jar:7.0.59] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) [catalina.jar:7.0.59] @ de.hybris.platform.webservicescommons.filter.sessionhidingfilter.dofilter(sessionhidingfilter.java:44) [webservicescommonsserver.jar:?] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) [catalina.jar:7.0.59] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) [catalina.jar:7.0.59] @ de.hybris.platform.servicelayer.web.xssfilter.processpatternsanddofilter(xssfilter.java:293) [coreserver.jar:?] @ de.hybris.platform.servicelayer.web.xssfilter.dofilter(xssfilter.java:247) [coreserver.jar:?] @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) [catalina.jar:7.0.59] @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) [catalina.jar:7.0.59] @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:220) [catalina.jar:7.0.59] @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:122) [catalina.jar:7.0.59] @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:170) [catalina.jar:7.0.59] @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103) [catalina.jar:7.0.59] @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:116) [catalina.jar:7.0.59] @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:950) [catalina.jar:7.0.59] @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:421) [catalina.jar:7.0.59] @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1074) [tomcat-coyote.jar:7.0.59] @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:611) [tomcat-coyote.jar:7.0.59] @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:314) [tomcat-coyote.jar:7.0.59] @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) [?:1.8.0_102] @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) [?:1.8.0_102] @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) [tomcat-coyote.jar:7.0.59] @ java.lang.thread.run(unknown source) [?:1.8.0_102] caused by: org.springframework.security.oauth2.provider.nosuchclientexception: unknown client mobile_ios @ de.hybris.platform.webservicescommons.oauth2.client.impl.defaultclientdetailsservice.loadclient(defaultclientdetailsservice.java:59) ~[webservicescommonsserver.jar:?] @ de.hybris.platform.webservicescommons.oauth2.client.impl.defaultclientdetailsservice.loadclientbyclientid(defaultclientdetailsservice.java:42) ~[webservicescommonsserver.jar:?] @ org.springframework.security.oauth2.provider.client.clientdetailsuserdetailsservice.loaduserbyusername(clientdetailsuserdetailsservice.java:44) ~[spring-security-oauth2-2.0.6.release.jar:?] @ org.springframework.security.authentication.dao.daoauthenticationprovider.retrieveuser(daoauthenticationprovider.java:102) ~[spring-security-core-3.2.5.release.jar:3.2.5.release] ... 54 more

here had hybris 5.6 :

<?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict>     <key>defaults</key>     <dict>         <key>current_catalog_version_attribute_key</key>         <string>online</string>         <key>use_cache_attribute_key</key>         <string>true</string>         <key>current_store_attribute_key</key>         <string>electronics</string>         <key>current_catalog_attribute_key</key>         <string>electronicsproductcatalog</string>         <key>rest_url_attribute_key</key>         <string>rest/v2</string>         <key>current_root_category_key</key>         <string>1</string>         <key>yulm00574455a</key>         <string>empty</string>     </dict>     <key>debug</key>     <dict>         <key>host_attribute_key</key>         <string>xx.xx.xx.xx</string>         <key>port_attribute_key</key>         <string>9002</string>     </dict>     <key>release</key>     <dict>         <key>host_attribute_key</key>         <string>xx.xx.xx.xx</string>         <key>port_attribute_key</key>         <string>9002</string>     </dict> </dict> </plist> 

i remember had add yulm00574455a key make work.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -