-
-
Notifications
You must be signed in to change notification settings - Fork 199
fix: ability to publish iOS applications for users with two-factor authentication enabled #4903
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b1e750
feat: support accounts with two-factor authentication on publish
Fatme 802e8e6
feat: add apple-login command
Fatme a6e17e5
test: fix unit tests
Fatme 9ca5ba5
docs: add help for new options and command
Fatme b63f34e
fix: fix PR comments
Fatme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <% if (isJekyll) { %>--- | ||
| title: tns apple-login | ||
| position: 5 | ||
| ---<% } %> | ||
|
|
||
| # tns apple-login | ||
|
|
||
| ### Description | ||
|
|
||
| Uses the provided Apple credentials to obtain Apple session which can be used when publishing to Apple AppStore. | ||
|
|
||
| ### Commands | ||
|
|
||
| Usage | Synopsis | ||
| ---|--- | ||
| General | `$ tns apple-login [<Apple ID>] [<Password>]` | ||
|
|
||
| ### Arguments | ||
|
|
||
| * `<Apple ID>` and `<Password>` are your credentials for logging into iTunes Connect. | ||
|
|
||
| <% if(isHtml) { %>s | ||
|
|
||
| ### Related Commands | ||
|
|
||
| Command | Description | ||
| ----------|---------- | ||
| [appstore](appstore.html) | Lists applications registered in iTunes Connect. | ||
| [appstore upload](appstore-upload.html) | Uploads project to iTunes Connect. | ||
| [build](../project/testing/build.html) | Builds the project for the selected target platform and produces an application package that you can manually deploy on device or in the native emulator. | ||
| [build ios](../project/testing/build-ios.html) | Builds the project for iOS and produces an APP or IPA that you can manually deploy in the iOS Simulator or on device, respectively. | ||
| [deploy](../project/testing/deploy.html) | Builds and deploys the project to a connected physical or virtual device. | ||
| [run](../project/testing/run.html) | Runs your project on a connected device or in the native emulator for the selected platform. | ||
| [run ios](../project/testing/run-ios.html) | Runs your project on a connected iOS device or in the iOS Simulator, if configured. | ||
| <% } %> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { StringCommandParameter } from "../common/command-params"; | ||
|
|
||
| export class AppleLogin implements ICommand { | ||
| public allowedParameters: ICommandParameter[] = [new StringCommandParameter(this.$injector), new StringCommandParameter(this.$injector)]; | ||
|
|
||
| constructor( | ||
| private $applePortalSessionService: IApplePortalSessionService, | ||
| private $errors: IErrors, | ||
| private $injector: IInjector, | ||
| private $logger: ILogger, | ||
| private $prompter: IPrompter | ||
| ) { } | ||
|
|
||
| public async execute(args: string[]): Promise<void> { | ||
| let username = args[0]; | ||
| if (!username) { | ||
| username = await this.$prompter.getString("Apple ID", { allowEmpty: false }); | ||
| } | ||
|
|
||
| let password = args[1]; | ||
| if (!password) { | ||
| password = await this.$prompter.getPassword("Apple ID password"); | ||
| } | ||
|
|
||
| const user = await this.$applePortalSessionService.createUserSession({ username, password }); | ||
| if (!user.areCredentialsValid) { | ||
| this.$errors.failWithoutHelp(`Invalid username and password combination. Used '${username}' as the username.`); | ||
| } | ||
|
|
||
| const output = Buffer.from(user.userSessionCookie).toString("base64"); | ||
| this.$logger.info(output); | ||
| } | ||
| } | ||
| $injector.registerCommand("apple-login", AppleLogin); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.