cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

[Solved] Unexpected response code 401 while registering a user in Android B2C app

Former Member
0 Kudos
4,206

I am working with the Android B2C app. Whenever I try to login or register a new user I am getting the following error.

07-18 00:09:32.656 13152-13168/com.hybris.mobile.app.commerce.b2c.dev E/Volley: [2226] BasicNetwork.performRequest: Unexpected response code 401 for https://192.168.13.15:9002/authorizationserver/oauth/token

07-18 00:09:33.063 13152-13168/com.hybris.mobile.app.commerce.b2c.dev E/Volley: [2226] BasicNetwork.performRequest: Unexpected response code 401 for https://192.168.13.15:9002/authorizationserver/oauth/token

07-18 00:09:33.064 13152-13218/com.hybris.mobile.app.commerce.b2c.dev E/com.hybris.mobile.lib.http.manager.volley.VolleyPersistenceManager: Error with the Volley request 37ce0f0d-2a5f-45a2-9da5-f66701aa4eed: {"error":"invalid_client","error_description":"Bad client credentials"}

Can anyone please help me with this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Figured out how to solve the issue Just add the below impexes

INSERT_UPDATE OAuthClientDetails;clientId[unique=true] ;resourceIds ;scope ;authorizedGrantTypes ;authorities ;clientSecret ;registeredRedirectUri ;client-side ;hybris ;basic ;implicit,client_credentials ;ROLE_CLIENT ;secret ;http://localhost:9001/authorizationserver/oauth2_implicit_callback; ;mobile_android ;hybris ;basic ;authorization_code,refresh_token,password,client_credentials ;ROLE_CLIENT ;secret ;http://localhost:9001/authorizationserver/oauth2_callback;

INSERT_UPDATE OAuthClientDetails;clientId[unique=true] ;resourceIds ;scope ;authorizedGrantTypes ;authorities ;clientSecret ;registeredRedirectUri ;trusted_client ;hybris ;extended ;authorization_code,refresh_token,password,client_credentials ;ROLE_TRUSTED_CLIENT ;secret; ;

Answers (2)

Answers (2)

Huskar
Participant
0 Kudos

Check this--essentialdata_assistedservicewebservices.impex

Huskar
Participant
0 Kudos

This is like webservice error. I'll try to explain it via webservice example. When you try to hit any webservice url, it check that the person who is trying to access it i an authorized user. So what happens it looks for oauth token. For tis you need to create a client which will be used to create a token an evantually use that token to access you urls.

Former Member
0 Kudos

How do I create a client for my android app ?