Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastlane spaceauth --check_session does not catches some "session expired" cases. #22002

Open
4 tasks done
rainbowcardiod opened this issue May 2, 2024 · 2 comments
Open
4 tasks done

Comments

@rainbowcardiod
Copy link

New Issue Checklist

Issue Description

I am using fastlane spaceauth --check_session -u $appleid to automate the 2fa with SMS. The automation works, but at a certain point, after many builds, and let's say 2 days, the build fastfile fails with:

{"responseId"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
"resultCode"=>1100, 
"resultString"=>"Your session has expired. Please log in.", 
"userString"=>"Your session has expired. Please log in.", 
"creationTimestamp"=>"202x-0x-0xT1x:5x:02Z", 
"protocolVersion"=>"xxxxxx", 
"userLocale"=>"en_US", "requestUrl"=>"https://developer.apple.com/services-account/xxxxx/account/listTeams.action", 
"httpCode"=>200}

However, fastlane spaceauth --check_session -u $appleid returns normally with exit code 0. I believe spaceauth check_session does not catches Portal session expiration, but I am not sure.

Eventually, where can I catch the error response in the fastlane code?

@BrandyN11
Copy link

BrandyN11 commented May 3, 2024

For managing fastlane sessions, it’s recommended to create and use the session on the same machine to extend its validity. If spaceauth --check_session doesn’t catch the expiration, consider running a fastlane action that requires a valid session as a test. This can help identify if the session has indeed expired. mydestinycard login

@rainbowcardiod
Copy link
Author

I can reproduce the problem with the following lane

lane :GetPortalInfo do
                
          apple_id = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
          app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)

          Spaceship.login(apple_id)
          client = Spaceship::Portal.login()

          Spaceship.client.select_team
          team_id = Spaceship.client.team_id
          
          info = { teamId: client.team_id, team_id2: team_id }

          UI.message("Portal info #{info}")

        end

However, it happens randomly. By repeatedly launching the lane, sometimes I get "Your session has expired. Please log in.", others not.

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

No branches or pull requests

2 participants