How to get access_token from ADP Api using rest? - adp

Hi I'm tryinng to get access token using the below post URL https://accounts.adp.com/auth/oauth/v2/token?grant_type=client_credentials&scope=api and I'm setting basic authorization in header. While requesting I get 401 error.
{
"error": "invalid_request",
"error_description": "proper client ssl certificate was not presented"
}

It looks like you will need to resolve the issue of ADP issued client certificate first. https://developers.adp.com/articles/general/introduction-mutual-ssl (Mutual TLS/SSL Help from ADP Dev Site). You will need to contact your ADP support team if they have not issued you a client API (SSL) cert yet.

Related

Workfront API Auth request (Machine to Machine Application) is returning 404 error

I'm making an auth POST request to the https://example.my.workfront.com/integrations/oauth2/api/v1/jwt/exchange (note: actual request has 'example.my' subdomain replaced with the real Workfront subdomain for my org) endpoint with the required client_id, client_secret, and jwt_token values but receiving the following 404 response and error message in the Response:
{"statusCode":404,"error":true,"type":"Not Found","message":"Invalid Host"}
I searched the API docs and Workfront forum for any additional information on what could cause the error but had no luck. Does anyone know what is causing this error?
For context, this request seems to work fine from Postman on my local machine (i.e. auth token is returned) but fails on the server that is being used for this machine to machine application.
The issue was that the request to the Workfront API was including the port in the host Header value, i.e. example.my.workfront.com:443.
Excluding the port so the host Header value is in the format example.my.workfront.com resolved the issue and provided the expected 200 response with auth token.

cannot connecting Microsoft Flows with HTTP request using certificate authentification

I am a new user for Microsoft Flows.
I have a requirement for Connecting the Microsoft Flow with HTTP Request.
When connecting the HTTP Request, I am using the Client Certificate with the .pfx certificate file.
I am using the below format :
{ "type": "ClientCertificate", "pfx": "aGVsbG8g...d29ybGQ=", "password": "myPassword" }
I am adding the pfx file in Base64 Encoding Format and Password in Plain Text format.
While running the Flow, I get the below error :
BadRequest. Unable to load the certificate private key. Please check that the password of the authentication certificate is correct, then try again.
Thanks, :)
I have had a similar experience, but the solution here is simple: The error message is right, either you have the wrong or incomplete base64 certificate string (copy-paste errors happen) or you have the wrong password to the certificate. There really is nothing more to it, the JSON form looks fine.

Project Server 2016 PSI with ADFS

a customer of ours recently uses ADFS on their Project Server 2016 environment. We have some solutions deployed that communicate with PSI. After using ADFS, the PSI however cannot be reached. We receive following error:
The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was ''.
In ULS, I found following entries:
Claims Authentication 0 Unexpected User-Agent is empty
...
Authentication Authorization agb9s Medium Non-OAuth request. IsAuthenticated=False, UserIdentityName=, ClaimsCount=0
...
Claims Authentication af30r Medium Multiauth SPWebApplication with widnows enabled and MS-OFBA accepted was set to false for the request url 'https://***/PPM/_vti_bin/PSI/ProjectServer.svc'.
General b6p2 Medium Sending HTTP response 401 - text/plain:401 UNAUTHORIZED.
Does anyone have an idea how to solve this? Is there a sample available on how to deal with ADFS and PSI?

Woocommerce REST API https - Cannot Connect

Connecting to WooCommerce API, HTTP have no problems.
When I change the permalinks from http to https then try to connect using the https url I get:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot list resources.",
"data": {
"status": 401
}
}
I have an SSL cert, so I'm not sure why it won't work?
Please help,
Many thanks!
EDIT:
Request: HTTP
HTTPS
According to WooCommerce REST API documentation:
Occasionally some servers may not parse the Authorization header
correctly (if you see a “Consumer key is missing” error when
authenticating over SSL, you have a server issue). In this case, you
may provide the consumer key/secret as query string parameters
instead.
Check that orders parameters are in the same order as examples, no space. Or I would use basic HTTPS authentication, that's how I comunicate using https:
https://localhost/wp-json/wc/v1/orders?consumer_key=ck_xxxxxxxxxxxxxx&consumer_secret=xxxxxxxxxxxxxxx

Can't get authentication token from web api 2

I am new to Web Api 2. I am trying to build a project to explore token authorization. I created a new project in VS 2013 and selected the WebApi2 template and used Fiddler to emulate http requests. I didn't change anything in the template, just ran it as it was and tried to play with it with Fiddler. I successfully created a user by issuing request to /api/account/register but I can't login by issuing a POST request to the /Token endpoint. The request is:
http://localhost:YYYY/token?grant_type=password&password=admin123456&username=admin
(i also tried to pass the parameters as a json object in the request body).
I get back this:
{"error":"unsupported_grant_type"}
From other posts such as ASP.NET WEB API 2 OWIN Authentication unsuported grant_Type I learned that I needed to enable CORS for web api and at the token endpoint, but that hasn't worked for me.
Are you sure that you are sending POST request message and not GET?
If you simply go to the URL with query string (or open connection to this URL from your code) you are sending GET message by default. It's not what WebAPI with "/token" path is listening for.
If you are calling web service from same place, CORS is not needed. The error "unsupported_grant_type" could be in the format of the data you are passing server in post action.
Try sending with Content-Type application/x-www-form-urlencoded

Resources