Skip to content

Conversation

joshdholtz
Copy link
Member

@joshdholtz joshdholtz commented Oct 19, 2024

Motivation and Context

Fixes #26368

Apple has released a new version of their Apple ID auth that uses SIRP (well, their version at least). Apple ID auth is broken so need to fix.

Description

Soooooo much of this work was done by @snatchev over a year ago when he discovered this optional new auth system. We have forked his fork of sirp and have it over at https://github.com/fastlane/fastlane-sirp. This is released under a new RubyGem called fastlane-sirp. Its not an exact implementation of SRP but its Apple's version 🤷‍♂️

New FASTLANE_USE_LEGACY_PRE_SIRP_AUTH env

The FASTLANE_USE_LEGACY_PRE_SIRP_AUTH can be set to use the previous Apple ID auth logic (if it ever works again). I didn't feel comfortable deleting the path so put it behind this flag.

Testing Steps

Update Gemfile and run bundle install, bundle update fastlane, or bundle update

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "joshdholtz/apple-auth-sirp"

@joshdholtz joshdholtz force-pushed the joshdholtz/apple-auth-sirp branch from 3425a74 to 2136791 Compare October 19, 2024 19:46
@davidmdt21
Copy link

thank you so much . problem fixed ! work fine

@joshdholtz joshdholtz marked this pull request as ready for review October 20, 2024 17:38
Copy link
Member

@snatchev snatchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 thank you for your hard work!

@joshdholtz joshdholtz requested a review from snatchev October 21, 2024 00:19
Copy link
Member

@snatchev snatchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@joshdholtz joshdholtz merged commit 4c60226 into master Oct 21, 2024
7 checks passed
@joshdholtz joshdholtz changed the title [spaceship] New AppleID Auth with SIRP [spaceship] New AppleID Auth with SRP Oct 21, 2024
@Martin-Gonzalez90
Copy link

Hi there, thanks a lot for the fix. Just wanted to know that if setting the env FASTLANE_USE_LEGACY_PRE_SIRP_AUTH=true should be enough to use the previous system.

@cah-iswaria-sasi
Copy link

Hi there, thanks a lot for the fix. Just wanted to know that if setting the env FASTLANE_USE_LEGACY_PRE_SIRP_AUTH=true should be enough to use the previous system.

Hey @Martin-Gonzalez90 can you brief where exactly this ENV needs to be set? i am also facing the same issue although appstore connect pwd is correct, its not connecting and account got locked and now Access is Forbidden

@Stas-Buzunko
Copy link

I did set it, and it didn't work but functioned without it, so try running without it first.

Add a .env file to your Fastlane folder if you think you need it.

@Martin-Gonzalez90
Copy link

Hi there, thanks a lot for the fix. Just wanted to know that if setting the env FASTLANE_USE_LEGACY_PRE_SIRP_AUTH=true should be enough to use the previous system.

Hey @Martin-Gonzalez90 can you brief where exactly this ENV needs to be set? i am also facing the same issue although appstore connect pwd is correct, its not connecting and account got locked and now Access is Forbidden

I updated fastlane to latest version and set the env but still failed, but then suddenly started to work, so I don't know if this is a real fix or if the service was recovered.
I tried using a previous version of fastlane and also worked

@davidmdt21
Copy link

Hello and thanks for hard work . i try your way and 503 error fixed . but i have new problem a , i got AppleID Session , but i see after some hours session will not work and i must get new session for this appleid ! whats the problem ? i mean every 4-5 hours session not work and i must get new session !

@smurf28
Copy link

smurf28 commented Oct 23, 2024

Hello and thanks for hard work . i try your way and 503 error fixed . but i have new problem a , i got AppleID Session , but i see after some hours session will not work and i must get new session for this appleid ! whats the problem ? i mean every 4-5 hours session not work and i must get new session !

Hello @davidmdt21 , I have read the latest Fastlane auth code and attempted to implement this auth using Golang Language. Currently, It's not working. Request the Api https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=false, it still returns an error:{ "serviceErrors" : [ { "code" : "-20101", "message" : "Enter the email or phone number and password for your Apple Account.", "suppressDismissal" : false } ] } I would like to ask what the cause of this issue could be. I tried so many times

@sunslikes
Copy link

Hello and thanks for hard work . i try your way and 503 error fixed . but i have new problem a , i got AppleID Session , but i see after some hours session will not work and i must get new session for this appleid ! whats the problem ? i mean every 4-5 hours session not work and i must get new session !您好,感谢您的辛勤工作。我尝试了你的方法并修复了 503 错误。但我遇到了新问题,我获得了 AppleID 会话,但我看到几个小时后会话将无法工作,我必须为该 appleid 获得新会话!有什么问题吗?我的意思是每 4-5 小时的课程不起作用,我必须进行新的课程!

Hello @davidmdt21 , I have read the latest Fastlane auth code and attempted to implement this auth using Golang Language. Currently, It's not working. Request the Api https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=false, it still returns an error:{ "serviceErrors" : [ { "code" : "-20101", "message" : "Enter the email or phone number and password for your Apple Account.", "suppressDismissal" : false } ] } I would like to ask what the cause of this issue could be. I tried so many times您好,我已经阅读了最新的 Fastlane 身份验证代码并尝试使用 Golang 语言实现此身份验证。目前,它不起作用。请求 Api https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=false ,它仍然返回错误: { "serviceErrors" : [ { "code" : "-20101", "message" : "Enter the email or phone number and password for your Apple Account.", "suppressDismissal" : false } ] } 我想请问一下这个问题的原因可能是什么。我尝试了很多次

I just had this problem, until I added all the code that needed to be filled with zeros.

@rickpasetto
Copy link

Just want to note: we use an Apple App Store API key instead of a Apple ID. After updating to this version (2.225.0), our uploads started failing. Is this expected?

Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens

Downgrading to 2.223.1 fixed the problem.

@Mihai-github
Copy link

Mihai-github commented Nov 1, 2024

Other than updating the fastlane version what are the next steps for making this work? Would be helpful to get some documentation update maybe please since for some of us may be hard to understand what we need exactly to do to make this work again.

@Martin-Gonzalez90
Copy link

After I run

unset FASTLANE_PASSWORD
unset FASTLANE_APP_SPECIFIC_PASSWORD
unset FASTLANE_SESSION 
unset FASTLANE_USE_LEGACY_PRE_SIRP_AUTH

spaceauth started to work

@Mihai-github
Copy link

After I run

unset FASTLANE_PASSWORD
unset FASTLANE_APP_SPECIFIC_PASSWORD
unset FASTLANE_SESSION 
unset FASTLANE_USE_LEGACY_PRE_SIRP_AUTH

spaceauth started to work

Hey, thanks for the response ... for me I keep getting the same error and I don't know what to do anymore ... I've included in my Gemfile this 2 and installed them:

gem 'fastlane', '2.225.0'
gem 'fastlane-sirp', :git => "https://github.com/fastlane/fastlane-sirp"

I really don't know what I have to do, or what to set so the authentication works ... do you changed something else or?

@Martin-Gonzalez90
Copy link

After I run

unset FASTLANE_PASSWORD
unset FASTLANE_APP_SPECIFIC_PASSWORD
unset FASTLANE_SESSION 
unset FASTLANE_USE_LEGACY_PRE_SIRP_AUTH

spaceauth started to work

Hey, thanks for the response ... for me I keep getting the same error and I don't know what to do anymore ... I've included in my Gemfile this 2 and installed them:

gem 'fastlane', '2.225.0'
gem 'fastlane-sirp', :git => "https://github.com/fastlane/fastlane-sirp"

I really don't know what I have to do, or what to set so the authentication works ... do you changed something else or?

Nope, I'm using directly fastlane v2.225.0

@dplcz
Copy link

dplcz commented Aug 13, 2025

Hello and thanks for hard work . i try your way and 503 error fixed . but i have new problem a , i got AppleID Session , but i see after some hours session will not work and i must get new session for this appleid ! whats the problem ? i mean every 4-5 hours session not work and i must get new session !您好,感谢您的辛勤工作。我尝试了你的方法并修复了 503 错误。但我遇到了新问题,我获得了 AppleID 会话,但我看到几个小时后会话将无法工作,我必须为该 appleid 获得新会话!有什么问题吗?我的意思是每 4-5 小时的课程不起作用,我必须进行新的课程!

Hello @davidmdt21 , I have read the latest Fastlane auth code and attempted to implement this auth using Golang Language. Currently, It's not working. Request the Api https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=false, it still returns an error:{ "serviceErrors" : [ { "code" : "-20101", "message" : "Enter the email or phone number and password for your Apple Account.", "suppressDismissal" : false } ] } I would like to ask what the cause of this issue could be. I tried so many times您好,我已经阅读了最新的 Fastlane 身份验证代码并尝试使用 Golang 语言实现此身份验证。目前,它不起作用。请求 Api https://idmsa.apple.com/appleauth/auth/signin/complete?isRememberMeEnabled=false ,它仍然返回错误: { "serviceErrors" : [ { "code" : "-20101", "message" : "Enter the email or phone number and password for your Apple Account.", "suppressDismissal" : false } ] } 我想请问一下这个问题的原因可能是什么。我尝试了很多次

I just had this problem, until I added all the code that needed to be filled with zeros.

Could you tell me where zero-padding needs to be added? My current code has different responses when testing different accounts. Some can directly reach the two-factor authentication stage, while others consistently return a 401 response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apple ID auth not working - 503 Service Temporarily Unavailable on various fastlane modules