Errore di accesso: c'è un problema con il tuo account. Contatta l'amministratore del sito

Errore di accesso: c’è un problema con il tuo account. Contatta l’amministratore del sito.

Sto riscontrando un errore di accesso segnalato solo da due utenti, che si presenta e scompare nel tempo. Io e molti altri utenti riusciamo ad accedere senza problemi. Secondo i log del servizio Discourse CAS SSO, l’utente viene reindirizzato al forum senza alcun errore registrato. Questo è un errore con cui qualcuno di voi ha familiarità? Dove posso trovare altri log per aiutarmi a individuare questo bug?

I nomi utente sono gli stessi, tranne che per un account in cui le lettere hanno un diverso uso di maiuscole e minuscole. Il nome utente dell’altro utente è esattamente identico. Gli indirizzi email sul nostro server CAS corrispondono a quelli sul forum. Stiamo eseguendo l’ultima versione di Discourse, aggiornata a pochi giorni fa. Non stiamo applicando patch nel codice dell’applicazione.

Potrebbe essere una coincidenza, ma il problema è scomparso temporaneamente per uno dei nostri utenti dopo il riavvio del servizio CAS SSO, ma ora non riescono più ad accedere al forum. (In quel momento, solo un utente segnalava questo problema.) Spero di trovare una soluzione permanente al problema.

Ho suggerito a uno degli utenti di inserire nel browser solo il nome di dominio del forum, senza alcun percorso, ma non ha riportato successo con questo tentativo. Secondo i log, almeno un utente riesce a superare la fase iniziale di accesso, quindi dubito che il problema sia causato dall’inserimento di un URL errato nel browser o dall’uso di un segnalibro non valido.

Ecco uno screenshot dell’errore:

Ho trovato i log del provider SSO associati al tentativo di accesso fallito, abbinando un parametro presente nello screenshot. Li ho confrontati con un accesso riuscito da parte mia e le uniche differenze riguardavano i parametri sso e sig, il numero del ticket CAS, i timestamp, gli indirizzi IP, ecc. Entrambi i log erano molto simili, il che suggerisce che le prime fasi di validazione SSO funzionano correttamente. Includo qui una versione modificata del log di accesso del provider SSO associato al tentativo fallito:

I, [2019-02-05T05:31:33.683842 #18023]  INFO -- : Started GET "/?sso=...&sig=..." for ... at 2019-02-05 05:31:33 -0500
I, [2019-02-05T05:31:33.685726 #18023]  INFO -- : Processing by LoginController#login as HTML
I, [2019-02-05T05:31:33.685829 #18023]  INFO -- :   Parameters: {"sso"=>"...", "sig"=>"..."}
I, [2019-02-05T05:31:33.687034 #18023]  INFO -- : Redirected to https://forum.members.fsf.org/auth/cas
I, [2019-02-05T05:31:33.687299 #18023]  INFO -- : Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
I, [2019-02-05T05:31:33.812099 #18023]  INFO -- : Started GET "/auth/cas" for ... at 2019-02-05 05:31:33 -0500
I, [2019-02-05T05:31:49.217709 #18023]  INFO -- : Started GET "/auth/cas/callback?url&ticket=ST-..." for ... at 2019-02-05 05:31:49 -0500
I, [2019-02-05T05:31:49.256905 #18023]  INFO -- : Processing by LoginController#create as HTML
I, [2019-02-05T05:31:49.257047 #18023]  INFO -- :   Parameters: {"url"=>nil, "ticket"=>"ST-...", "provider"=>"cas"}
I, [2019-02-05T05:31:49.259105 #18023]  INFO -- : inside allow_groups ["is_member"] empty? false
I, [2019-02-05T05:31:49.259686 #18023]  INFO -- : Redirected to https://forum.members.fsf.org/session/sso_login?sso=...&sig=...
I, [2019-02-05T05:31:49.260007 #18023]  INFO -- : Completed 302 Found in 3ms (ActiveRecord: 0.0ms)

Qualsiasi aiuto su questo problema sarebbe molto apprezzato.

Grazie! : D

I’ve seen the error you reported in the screenshot for users who were imported, but have never before logged in. In my case WP is the SSO provider and the “problem users” don’t have a Single Sign On section at the bottom of their user page.

Thanks for the input. In my case, they have logged in before, and they do have the SSO section at the bottom of their user account page.

Great news! I figured out how to reproduce the error. If I try to log in as “Sudoman” instead of “sudoman”, then this error appears. Our CAS server (i’m not referring to the CAS SSO service connected with Discourse) allows people to log in lto our systems like that.

In any case, presuming that the SSO provider is passing the user to Discourse with the user name of “Sudoman”, is this error message the desired behavior in Discourse, or is it a bug?

In my case, it would make sense to allow the user to log in, but in other systems, that could be a different user who is trying to log in.

I tried creating an account with capitalized letters in the user name, and an account was created with the same capitalization. Trying to log in again with all lower case letters caused an error. That makes sense to me.

Maybe it would make sense to create a resource that lists the list of possible causes that produces this error message. It would help systems administrators track down the issue when this happens to their users.

Thanks! :smiley: