-
Notifications
You must be signed in to change notification settings - Fork 392
@W-19368406: [MSDK] Local dev instant login (Android) #2785
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
@W-19368406: [MSDK] Local dev instant login (Android) #2785
Conversation
8409528
to
4b15565
Compare
Job Summary for GradlePull Request :: test-android |
Job Summary for GradlePull Request :: test-android |
|
||
<application> | ||
|
||
<!-- Debug-Only: Test Authentication Activity For Automated Testing --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's keeping it from being used in production? Should we check that we are in a debug build in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ought to be able to use the SalesforceSDKManager
isDebugBuild
check in the activity and simply finish without action for other build types.
…ed Test Failures)
…SDKManager isDebugBuild To Enable TestAuthenticationActivity)ˆ
Generated by 🚫 Danger |
Job Summary for GradlePull Request :: test-android |
…ed Test Failures)
b5dbee0
to
93ec5ff
Compare
…For Unrelated Failures)
Note the test failures I've observed are also present on |
…AndroidManifest.xml)
@Test | ||
fun topAppBar_ChangeServerButton_OpensServerPicker() { | ||
var showPicker: MutableState<Boolean>? = null | ||
val showPicker = mutableStateOf(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This subtle change resolves inspector warnings and should be acceptable for tests. I'd used the same style where dynamic background color is now used as well.
47550d1
into
forcedotcom:dev
🎸 Ready For Review 🥁
This adds a new activity which may be used for debug app builds only to authenticate a user via test credentials in automated tests. The new activity will finish without any action for app release builds. This is controlled by Salesforce Mobile SDK's existing
isDebugBuild
property.This new means of automating authentication for debug testing does not expose production builds to risk and also minimizes access since usernames and passwords are not used. The test credentials JSON provided by Salesforce Mobile SDK's REST Explorer sample app uses refresh tokens which can be remotely expired and cannot be used for privilege elevation beyond the public APIs.
From the shell, the new intent may be started using ADB.
The "App Package Namespace" is the app's package namespace, which is usually declared in the app module's Gradle script via
android { namespace
.The "Credentials JSON" can be obtained by running the existing Salesforce Mobile SDK REST Explorer sample app, logging in and then using the "Dev Menu" "Export Credentials To Clipboard" menu item.
Note that the shell invocation must preserve quotations and other potentially interpreted characters from the shell such that the Credentials JSON is received by the activity without alteration.
The new intent could also be launched by UIAutomator2.
Appium is another means of launching the new intent.