LINCnil / pia-back

Programme développé avec le framework RubyOnRails mettant à disposition une API RESTful à destination des outils PIA et PIA-APP. | Program developped with RubyOnRails providing a RESTful API for the PIA and PIA-APP applications.
GNU General Public License v3.0
156 stars 65 forks source link

SIGN IN, i receive an error with "authentication.errors.sign_in.401 #177

Closed cargamagno70 closed 1 year ago

cargamagno70 commented 2 years ago

i try to use this software, but when i put Login e Password in SIGN IN, i receive an error with "authentication.errors.sign_in.401" error code, and the log is:

_Started POST "/oauth/token" for 127.0.0.1 at 2022-07-05 13:50:25 +0200 Processing by Doorkeeper::TokensController#create as / Parameters: {"email"=>"pia", "password"=>"[FILTERED]", "grant_type"=>"password", "client_id"=>"1", "client_secret"=>"[FILTERED]"} Doorkeeper::Application Load (0.3ms) SELECT "oauth_applications". FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT $2 [["uid", "1"], ["LIMIT", 1]] User Load (1.1ms) SELECT "users". FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["email", "pia"], ["LIMIT", 1]] ↳ config/initializers/doorkeeper.rb:366:in `block (2 levels) in

' Completed 401 Unauthorized in 5ms (Views: 0.2ms | ActiveRecord: 1.4ms | Allocations: 2144)_

can someone help me to understand where i am wrong ?

thanks a lot

syl-p commented 2 years ago

Hello @cargamagno70 ,

the "authentication.errors.sign_in.401" code was not translate, I will add it to pia-i18n repo; but... It's mean i the client_id or client_secret could be wrong.

Can you check your client_id and client_secret ?

kevin-atnos commented 1 year ago

Hello @cargamagno70,

Do you still have some issue with the authentication? We recently updated our README about authentication mode, maybe you can give it another try and re-follow the whole process: https://github.com/LINCnil/pia-back#enable-the-authentication-mode It might be related to the CLIENT_ID and / or CLIENT_SECRET as said @syl-p.

Regards,

kevin-atnos commented 1 year ago

Closing the issue, if the issue still occurs, feel free to re-open it and we can re-discuss it.