Why i am been automatically login when running this command “Connect-PnPOnline -UseWebLogin"

%3CLINGO-SUB%20id%3D%22lingo-sub-1897588%22%20slang%3D%22en-US%22%3EWhy%20i%20am%20been%20automatically%20login%20when%20running%20this%20command%20%E2%80%9CConnect-PnPOnline%20-UseWebLogin%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1897588%22%20slang%3D%22en-US%22%3E%3CDIV%20class%3D%22s-prose%20js-post-body%22%3E%3CP%3EI%20run%20the%20following%20PnP%20command%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EConnect-PnPOnline%20-Url%20%3CSPAN%20class%3D%22hljs-string%22%3E%22https%3A%2F%2F***.sharepoint.com%2Fsites%2FApprovalProcess%2F%22%3C%2FSPAN%3E%20-UseWebLogin%3C%2FPRE%3E%3CP%3Enow%20a%20dialog%20will%20open%20and%20login%20me%20automatically%2C%20and%20when%20i%20try%20to%20perform%20any%20action%20i%20will%20get%20access%20denied...%20so%20seem%20i%20am%20been%20login%20using%20different%20username..%20so%20how%20i%20can%20force%20the%20above%20command%20to%20ask%20me%20for%20the%20username%20and%20password%20and%20without%20logging%20me%20in%20automatically..%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1897588%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1960550%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20i%20am%20been%20automatically%20login%20when%20running%20this%20command%20%E2%80%9CConnect-PnPOnline%20-UseWebLogin%26amp%3Bquot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1960550%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F233354%22%20target%3D%22_blank%22%3E%40john%20john%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUpdate%20your%20PnP%20PowerShell%20modules%20to%20latest%20version%20and%20try%20using%20below%20command%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-PnPOnline%20-Url%20%22https%3A%2F%2F***.sharepoint.com%2Fsites%2FApprovalProcess%2F%22%20-UseWebLogin%20-ForceAuthentication%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EReference%3C%2FSTRONG%3E%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FPnpPowershell%2Fstatus%2F1335362866069856258%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ETwitter%20post%20by%20official%20PnP%20PowerShell%20account%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Valued Contributor

I run the following PnP command:-

 

Connect-PnPOnline -Url "https://***.sharepoint.com/sites/ApprovalProcess/" -UseWebLogin

now a dialog will open and login me automatically, and when i try to perform any action i will get access denied... so seem i am been login using different username.. so how i can force the above command to ask me for the username and password and without logging me in automatically..

1 Reply

@john john 

Update your PnP PowerShell modules to latest version and try using below command:

 

 

Connect-PnPOnline -Url "https://***.sharepoint.com/sites/ApprovalProcess/" -UseWebLogin -ForceAuthentication

 

 

ReferenceTwitter post by official PnP PowerShell account 


Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.