aKumpan opened a new issue #20020:
URL: https://github.com/apache/airflow/issues/20020


   ### Apache Airflow version
   
   2.2.2 (latest released)
   
   ### Operating System
   
   composer-1.17.3-airflow-2.1.2
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Composer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Getting "401 Unauthorized" error when accessing Airflow Stable REST api with 
service accounts having email longer than 64 symbols.
   Successfully Accessing API with service accounts email <64 symbols. 
   Details:
   https://stackoverflow.com/a/70217282/9583820
   
   ### What you expected to happen
   
   Google Cloud Platform service accounts emails are usually very long due to 
domain part.
   I would expect longer emails to work with Airflow
   
   ### How to reproduce
   
   I think the same will reproduce for every environment, but my issue happened 
on this:
   composer-1.17.3-airflow-2.1.2 (Google Cloud Platform)
   
   Set "api-auth_backend" to "airflow.composer.api.backend.composer_auth"
   Make sure your service account has required permissions (Composer User role 
should be sufficient)
   Make sure your service account email length is >64 symbols
   Provide Bearer token for the request
   
   Result:
   Requests to Stable API will fail with "401 Unauthorized" 
   
   Change service account to have email <64 symbols
   Result:
   Requests sucessed
   
   
   ### Anything else
   
   I think updating tables:
   public.ab_register_user
   public.ab_user
   
   to have email field to be VARCHAR(320) as per 
   RFC 5321 (the current SMTP spec, obsoletes RFC2821) states:
   The maximum total length of a user name or other local-part is 64 octets. 
The maximum total length of a domain name or number is 255 octets
   
   Should fix the issue.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to