FACEIT Connect: 401 during the token request


#1

Hello. We’re trying to implement oauth authorization using FACEIT Connect.

Currently we got stuck at getting the authorization token after getting the code. The endpoint replies: 401 Unauthorized.

The documentation says that the “request must use HTTP Basic Authentication “Authorization” header (using your Client ID and Client Secret)”. But it’s not entirely clear how exactly that header should look like? ClientID, then Client Secret appended to it? Without spaces?

UPD
The format is the same as specified for Client Credentials Flow - Base64 encoded string of <CLIENT_ID:CLIENT_SECRET>.


#2

Ok, so now the question is about getting the user profile.

Authorization request says that “scope”:“openid profile membership email”.

But trying to call http://api.faceit.com/auth/v1/resources/userinfo, it fails with: {“error”:“insufficient_scope”,“error_description”:“Insufficient scope for this resource”,“scope”:“openid”}

What’s the proper authorization procedure for this resource? Should it be the client+secret token as before, or should it be the access token?


#3

Hi Advgram,
to obtain the current user’s profile it is sufficient, once you obtain a valid access_token, to issue the following GET request:

curl -X GET \
  http://api.faceit.com/auth/v1/resources/userinfo \
  -H 'Authorization: Bearer <your_access_token>' \
  -H 'Cache-Control: no-cache'

Please let me know if this answers your question.
Regards,

Andy
Developer Tools Team


#4

Thanks, this helped.

Before we implemented this method we tried getting userinfo from the id token. While doing so we noticed that data in some of id tokens is broken. If you want, we have some examples saved.


#5

I have a problem then a play faceit with my friend. So i have a LAN connection but he have a wifi connection(notebook), on the same router, and if i am connecting first he can’t connect, but if he is connecting first i can’t connect…Pls help, what i have to do?


#6

Hi there,
I’m afraid your question is beyond the scope of this section of the forum, which is dedicated to app & game Development tools.
Please start a new thread on the Community Forum.
Cheers,

Andy
Developer Tools Team