I`m trying to access discovery service from .NET application running on another machine in order to query broker database. But I'm getting the error "Unauthorized request".
Applications app.config file has the following settings:
<add key="discovery-service-uri" value="http://somemachine:8082/discovery.svc" />
<add key="oauth‐enabled" value="true" />
<add key="oauth‐client‐id" value="cduser" />
<add key="oauth‐client‐secret" value="CDUserP@ssw0rd" />
Discovery service and Session Enabled Content service have OAuth Enabled and cduser specified in cd_ambient.conf. All capabilities are registered and updated, and none of the services is on localhost (CIS services run on a different machine than the web application). I tried accessing the discovery service with Fiddler and passed the Bearer token, and everything works ok.
I also checked the discovery service cd_adf.log file and found:
Capabilities listed in cd_storage_conf:
I would appreciate any suggestions and guidance on how access token should be passed in case of using Content Interaction Library.
EDIT: Replied here because the comment section has limited capability...
I was following the instructions on:
I'm using cduser
+ oauth set to true and I'm but getting the following:
Unauthorized Request -- Please check your configuration settings to make sure your authentication details are correct.
@Velmurugan, Rick, this is what I get in cd_client.log:
2018-07-05 10:50:58 DEBUG [Sdl.Web.Delivery.DiscoveryService.DiscoveryServiceProvider..ctor] - Attempting to construct discovery-service provider.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider..ctor] - Using token-service: http://somemachine:8082/token.svc
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Attempting to get token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Failed to get OAuth token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.DiscoveryService.DiscoveryServiceProvider..ctor] - Finished constructing discovery-service provider.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Attempting to get token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Failed to get OAuth token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.Utils.Retry] - Request failed due to authentication exception. Trying again.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Attempting to get token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Failed to get OAuth token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.Utils.Retry] - Request failed due to authentication exception. Trying again.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Attempting to get token from token-service.
2018-07-05 10:50:59 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Failed to get OAuth token from token-service.
2018-07-05 10:51:00 DEBUG [Sdl.Web.Delivery.Service.Utils.Retry] - Request failed due to authentication exception. Trying again.
2018-07-05 10:51:00 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Attempting to get token from token-service.
2018-07-05 10:51:00 DEBUG [Sdl.Web.Delivery.Service.OAuthTokenProvider.CreateOrRefreshToken] - Failed to get OAuth token from token-service.
2018-07-05 10:51:00 ERROR [Sdl.Web.Delivery.ContentService.ContentServiceProvider..ctor]
Problem authenticating with service. Please make sure your authentication settings are correct and you have enabled authentication.