Has anybody configured CAS as a form of authentication?

Here’s what I have so far.

Configured CAS with JDBC storage option on the backend
Registered Mastodon as a service using the JSON storage option

When I open Mastodon, the only way to get to CAS is by logging in as an existing mastodon user, logging out and getting to the SignIn page (/auth/login route). When I click on CAS button it redirects me to the CAS login page (which is to be expected).

However, when I enter my credentials it fails with the following error message on the web page

Validation failed: Account username can’t be blank, Account username only letters, numbers and underscores

In the logs, I see
11:40:20 web.1 | SessionActivation Load (0.6ms) SELECT “session_activations”.* FROM “session_activations” WHERE “session_activations”.“session_id” IS NULL LIMIT $1 [[“LIMIT”, 1]]
11:40:20 web.1 | Identity Load (0.9ms) SELECT “identities”.* FROM “identities” WHERE “identities”.“uid” IS NULL AND “identities”.“provider” = $1 LIMIT $2 [[“provider”, “cas”], [“LIMIT”, 1]]
11:40:20 web.1 | (0.2ms) BEGIN
11:40:20 web.1 | Identity Exists (0.5ms) SELECT 1 AS one FROM “identities” WHERE “identities”.“uid” IS NULL AND “identities”.“provider” = $1 LIMIT $2 [[“provider”, “cas”], [“LIMIT”, 1]]
11:40:20 web.1 | (0.3ms) ROLLBACK
11:40:20 web.1 | Account Exists (0.5ms) SELECT 1 AS one FROM “accounts” WHERE “accounts”.“username” IS NULL LIMIT $1 [[“LIMIT”, 1]]
11:40:20 web.1 | (0.2ms) BEGIN
11:40:20 web.1 | User Exists (0.5ms) SELECT 1 AS one FROM “users” WHERE “users”.“email” = $1 LIMIT $2 [[“email”, “change@me–cas.com”], [“LIMIT”, 1]]
11:40:20 web.1 | EmailDomainBlock Exists (0.8ms) SELECT 1 AS one FROM “email_domain_blocks” WHERE “email_domain_blocks”.“domain” = $1 LIMIT $2 [[“domain”, “me–cas.com”], [“LIMIT”, 1]]
11:40:20 web.1 | (0.3ms) ROLLBACK
11:40:20 web.1 | Completed 422 Unprocessable Entity in 176ms (ActiveRecord: 4.7ms)
11:40:20 web.1 | ActiveRecord::RecordInvalid - Validation failed: Account username can’t be blank, Account username only letters, numbers and underscores:
11:40:20 web.1 | app/models/concerns/omniauthable.rb:51:in create_for_oauth' 11:40:20 web.1 | app/models/concerns/omniauthable.rb:32:infind_for_oauth’
11:40:20 web.1 | app/controllers/auth/omniauth_callbacks_controller.rb:10:in `block in provides_callback_for’

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.