Skip to content

Commit e0dec71

Browse files
authored
Edit with Branch Versioning: remove authentication handler (#577)
* amend readme * hard code authentication in controller * reorder authentication settings
1 parent 3b9790d commit e0dec71

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

editing/edit-with-branch-versioning/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Workflows often progress in discrete stages, with each stage requiring the alloc
1010

1111
## How to use the sample
1212

13-
Upon opening the sample, you will be prompted to enter credentials for the service (un: editor01 / pwd: editor01.password). Once loaded, the map will zoom to the extent of the feature layer. The current version is indicated in the top left corner of the map. You can create a new version by specifying the version information (name, access, and description) in the form in the top right corner, and then clicking "Create version". See the *Additional Information* section for restrictions on the version name.
13+
Once loaded, the map will zoom to the extent of the feature layer. The current version is indicated in the top left corner of the map. You can create a new version by specifying the version information (name, access, and description) in the form in the top right corner, and then clicking "Create version". See the *Additional Information* section for restrictions on the version name.
1414

1515
Select a feature using the primary mouse button to edit an attribute and/or click again with the secondary mouse button to relocate the point.
1616

@@ -44,10 +44,6 @@ The feature layer used in this sample is [Damage to commercial buildings](https:
4444

4545
## Additional information
4646

47-
Credentials:
48-
- Username: editor01
49-
- Password: editor01.password
50-
5147
The name of the version must meet the following criteria:
5248

5349
1. Must not exceed 62 characters

editing/edit-with-branch-versioning/src/main/java/com/esri/samples/edit_with_branch_versioning/EditWithBranchVersioningController.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
import com.esri.arcgisruntime.mapping.Viewpoint;
4848
import com.esri.arcgisruntime.mapping.view.IdentifyLayerResult;
4949
import com.esri.arcgisruntime.mapping.view.MapView;
50-
import com.esri.arcgisruntime.security.AuthenticationManager;
51-
import com.esri.arcgisruntime.security.DefaultAuthenticationChallengeHandler;
50+
import com.esri.arcgisruntime.security.UserCredential;
5251

5352
public class EditWithBranchVersioningController {
5453

@@ -91,13 +90,17 @@ public void initialize() {
9190
}
9291
});
9392

94-
// handle authentication for the service geodatabase
95-
AuthenticationManager.setAuthenticationChallengeHandler(new DefaultAuthenticationChallengeHandler());
96-
97-
// create and load a service geodatabase
93+
// create a service geodatabase
9894
serviceGeodatabase = new ServiceGeodatabase("https://sampleserver7.arcgisonline" +
9995
".com/arcgis/rest/services/DamageAssessment/FeatureServer");
96+
97+
// set the user credentials required to authenticate with the service geodatabase
98+
UserCredential userCredential = new UserCredential("editor01", "editor01.password");
99+
serviceGeodatabase.setCredential(userCredential);
100+
101+
// load the service geodatabase
100102
serviceGeodatabase.loadAsync();
103+
101104
serviceGeodatabase.addDoneLoadingListener(() -> {
102105
if (serviceGeodatabase.getLoadStatus() == LoadStatus.LOADED) {
103106

0 commit comments

Comments
 (0)