By: Paul Frame user 20 Feb 2015 at 4:50 p.m. CST

6 Responses
Paul Frame gravatar
I am using an old wordpress plugin as a base for client authentication. Everything works fine until I use the "code" to request a token. I send the following to the token endpoint: [code] => code-received-goes-here [client_id] => @!proper.id.of.theclient [client_secret] => supersecretpassword [redirect_uri] => http://myopenidclient.com/wp-admin/admin-ajax.php?action=openidconn-callback [grant_type] => authorization_code And the server responds with: {"error":"invalid_client","error_description":"Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method)."} I am trying really hard to understand the authorization process and whatnot and have gone over the API, but I haven't got a clue what is causing this error. Any ideas? Also, in glue on the client edit page, is "update password" equivalent to updating the "client secret"?

By Mohib Zico Account Admin 21 Feb 2015 at 1:30 a.m. CST

Mohib Zico gravatar
Hi Paul, Can you please check if your client is available in your Gluu server? Here is [how](http://www.gluu.org/docs/admin-guide/oxTrust/oauth2/) you can check that.

By Paul Frame user 23 Feb 2015 at 11:53 a.m. CST

Paul Frame gravatar
My Client is definitely setup: ======================================================================================== Inum @!A561.3AD5.2A5B.C236!0001!3392.EE0C!0008!EDE1.0E9D Display Name* plugintestmanualSubmit Application Type* Web Algorithm* HS256 Pre-Authorization* Enabled <~(not entirely sure what this means) Authentication method client_secret_basic Redirect Login URIs: http://staging.lds.net/plugintest/wp-admin/admin-ajax.php?action=openidconn-callback https://seed.gluu.org/oxauth-rp/home.seam http://staging.lds.net/plugintest/wp-admin/admin-ajax.php Redirect Logout URIs: <none yet> Scopes: email openid phone user_name Response Type: Authorization Code Grant Type Implicit Grant Type ID Token Authorized Groups: Gluu Manager Group testGroup ======================================================================================== And here is what I am having my PHP spit out when it encounters the error: The Request: request=https://auth.rubenator.com/oxauth/seam/resource/restv1/oxauth/token::Array ( [code] => 72f80e52-6a7d-4656-9231-70b10f35ee5e [client_id] => @!A561.3AD5.2A5B.C236!0001!3392.EE0C!0008!EDE1.0E9D [client_secret] => test [redirect_uri] => http://staging.lds.net/plugintest/wp-admin/admin-ajax.php?action=openidconn-callback [grant_type] => authorization_code ) The Response: result=Array ( [headers] => Array ( [date] => Mon, 23 Feb 2015 17:43:14 GMT [server] => Apache/2.4.7 (Ubuntu) [www-authenticate] => Basic realm="oxAuth" [content-type] => application/json;charset=ISO-8859-1 [content-length] => 586 [set-cookie] => JSESSIONID=F2B022FB18AC1CB138D62752C7CAB69E; Path=/oxauth/; Secure; HttpOnly;HttpOnly [connection] => close ) [body] => {"error":"invalid_client","error_description":"Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the Authorization request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code, and include the WWW-Authenticate response header field matching the authentication scheme used by the client."} [response] => Array ( [code] => 401 [message] => Unauthorized ) [cookies] => Array ( [0] => WP_Http_Cookie Object ( [name] => JSESSIONID [value] => F2B022FB18AC1CB138D62752C7CAB69E [expires] => [path] => /oxauth/ [domain] => auth.rubenator.com [secure] => [httponly] => ) ) [filename] => )

By Mohib Zico Account Admin 24 Feb 2015 at 3:34 a.m. CST

Mohib Zico gravatar
>> {"error":"invalid_client","error_description":"Client authentication failed (e.g. unknown client, no client authentication included, or unsupported authentication method). The authorization server MAY return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the Authorization request header field, the authorization server MUST respond with an HTTP 401 (Unauthorized) status code, and include the WWW-Authenticate response header field matching the authentication scheme used by the client."} Interesting... you have client in IDP and you are getting "invalid_client" in response. I will talk to some folks here for more suggestion...

By Paul Frame user 24 Feb 2015 at 1:24 p.m. CST

Paul Frame gravatar
Is there a log I can/should look at? Which one?

By Paul Frame user 25 Feb 2015 at 1:26 p.m. CST

Paul Frame gravatar
Its because I'm sending the client and secret over a post. Changing the authentication method to clien_secret_post fixed this problem.

By Mohib Zico Account Admin 26 Feb 2015 at 5:31 a.m. CST

Mohib Zico gravatar
Oh great!! Learned a new thing. Thanks a bunch for sharing, Paul. Please keep testing and let us know the problem if you face any. Your suggestion is really valuable for us. Kind regards, Zico