Answered

Automating logging in as a different user in sharepoint

Scenario - Sharepoint application in NIH when opened in a browser automatically logins the user depending on which account is logged in Windows

For example - If I as the tester I am logged in my laptop with my NIH aacount then the sharepoint application on opening in chrome or IE automatically logs in as me (see below)

So when this test case runs in NIH VMs on the cloud it logs in as NHLBIProof1 which is signed in the VM.

To change the user logged in sharepoint to use different test accounts for testing different user roles, manually I do Shift + right click on the IE logo which bring up the IE menu where I select the run as a different user option

This brings up a login window where I can login using test accounts and the sharepoint now is logged in as the test account

Unfortunately automating this process using desktop commands or trying other ways to login in sharepoint is not working

Any help with this is appreciated

0
1 comment

Official comment

Avatar
Rex Feizi

This is Windows authentication on a government laptop.  As far as I have seen, there are measures built into the system to prevent such. For example, when you choose "Run as a different user" a screen will appear that you would require system permissions. 

 

I recommend the following: 

1. See if  can switch users using the Web Interface: https://blog.vinewave.com/how-to-sign-in-as-different-user-in-sharepoint-2013-2016-on-premise-956f1790d721/

2. Asking the developers/administrators of the share point site to allow a web interface or REST call to switch users. 

 

 

Comment actions Permalink

Please sign in to leave a comment.