Since I was worried that I might have forgotten my password, I logged out of hotmail and logged back in again and confirmed that I had not forgotten my password.
I finally got connect-AzureAD to work in elevated mode.
I believe I have restored the default directory as mentioned previously so this should not be causing any problem...
I have typed in all of Soumi's commands and I still get the same errors when I ".\Configure.ps" and I have carefully typed in my MSA credentials (which work with hotmail) several times now.
I tried to pick the simplest tutorial I could to demonstrate authentication with C# and my MSA. This example also does the "work or school feature" (is this also known as B2B?) and I'm not terribly interested in the "work or school feature" (yet).
Could the problem be that I need a premium azure account for this "work or school" featuer? If this is the problem, could someone recommend another minimal example that demonstrates authentication with a C#/.NETCore Web app for a MSA (like my hotmail account). After I get authentication with a MSA working, I'd like to try a tutorial that demonstrates giving the user a choice of MSA or google/facebook/github (I think this is B2C).
Here are the errors from ".\Configure.ps1" after typing Soumi's commands:
Get-AzureADTenantDetail : Error occurred while executing GetTenantDetails
Code: Authentication_Unauthorized
Message: User was not found.
RequestId: 18d9126c-2a19-4610-9fc1-03ffcd493935
DateTimeStamp: Tue, 12 May 2020 20:37:01 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At C:\Users\shein\Source\Repos\MicrosoftAADGitHubExamples\VariousSignInEg\1-WebApp-OIDC\1-3-AnyOrgOrPersonal\AppCreationScripts\C
onfigure.ps1:95 char:15
- $tenant = Get-AzureADTenantDetail
- ~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Get-AzureADTenantDetail], ApiException
- FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetTenantDetails
Get-AzureADUser : Error occurred while executing GetUser
Code: Authentication_Unauthorized
Message: User was not found.
RequestId: b7a6b8d7-a6f6-46a2-a4ea-d0b3eeaf728e
DateTimeStamp: Tue, 12 May 2020 20:37:01 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At C:\Users\shein\Source\Repos\MicrosoftAADGitHubExamples\VariousSignInEg\1-WebApp-OIDC\1-3-AnyOrgOrPersonal\AppCreationScripts\C
onfigure.ps1:99 char:13
- $user = Get-AzureADUser -ObjectId $creds.Account.Id
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [Get-AzureADUser], ApiException
- FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetUser
Creating the AAD application (WebApp)
New-AzureADApplication : Error occurred while executing NewApplication
Code: Authentication_Unauthorized
Message: User was not found.
RequestId: be328ca7-8009-4589-befa-a895286123a1
DateTimeStamp: Tue, 12 May 2020 20:37:02 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At C:\Users\shein\Source\Repos\MicrosoftAADGitHubExamples\VariousSignInEg\1-WebApp-OIDC\1-3-AnyOrgOrPersonal\AppCreationScripts\C
onfigure.ps1:103 char:28
- ... webAppAadApplication = New-AzureADApplication -DisplayName "WebApp" `
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [New-AzureADApplication], ApiException
- FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.NewApplication
Get-AzureADApplicationOwner : Cannot bind argument to parameter 'ObjectId' because it is null.
At C:\Users\shein\Source\Repos\MicrosoftAADGitHubExamples\VariousSignInEg\1-WebApp-OIDC\1-3-AnyOrgOrPersonal\AppCreationScripts\C
onfigure.ps1:116 char:51
- ... Get-AzureADApplicationOwner -ObjectId $webAppAadApplication.ObjectId
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Get-AzureADApplicationOwner], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Open.AzureAD16.PowerShell.GetApplicationO
wners
Add-AzureADApplicationOwner : Cannot bind argument to parameter 'ObjectId' because it is null.
At C:\Users\shein\Source\Repos\MicrosoftAADGitHubExamples\VariousSignInEg\1-WebApp-OIDC\1-3-AnyOrgOrPersonal\AppCreationScripts\C
onfigure.ps1:119 char:47
- ... reADApplicationOwner -ObjectId $webAppAadApplication.ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Add-AzureADApplicationOwner], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Open.AzureAD16.PowerShell.AddApplicationO
wner