pherbel / AzureAd-b2c-aspnet5

Azure Ad B2C Sample for asp.net 5
4 stars 0 forks source link

Sign In/Up does not open up the B2C sign in/up page #1

Open JCAnsus opened 8 years ago

JCAnsus commented 8 years ago

Hi,

I'm testing your code against my test B2C setup. The app compiles and runs but whenever I click sign in or sign up, it doesn't open the B2C sign in or sign up page.

I hope you can help me on this.

Thanks!

Here are my settings:

"AzureADSettings": { "ClientId": "f55791d5-b837-4e5d-92ec-4c03053049b5", "Tenant": "PKSMakatiB2C.onmicrosoft.com", "AadInstance": "https://login.microsoftonline.com/{0}{1}{2}", "PostLogoutRedirectUri": "http://localhost:57463/", "RedirectUri": "http://localhost:57463/", "SignUpPolicyId": "B2C_1_NetCore_Test", "SignInPolicyId": "B2C_1_NetCore_Test_2", "UserProfilePolicyId": "B2C_1_NetCore_Test_3" }

wislon commented 8 years ago

@JCAnsus I had a similar issue when trying to do something else in a mobile app.

Check in your portal settings for the Sign-up or Sign-in Policy. You need to make one for this too if you want the sign-up AND sign-in options page to appear.

Have a look at (New Portal, for your tenant) - Azure AD B2C Settings | All Settings | Policies

Under there you'll see the one for 'sign up or sign in'. If you make one of those (maybe in your case B2C_1_NetCore_Test_4 ?) it should work for you, provided you tell it exactly which policy to work with.

Personally I'd make the names a bit less generic coz hunting them down later in your code and trying to remember which one is which becomes a pain after a bit, especially if you're tracking it across several platforms :wink:

HTH :)

JCAnsus commented 8 years ago

@wislon Sorry I wasn't clear with how I framed my question. What I meant is when I click on sign-in, the sign in page doesn't show. The app immediately redirects me back to the default page (index.cshtml). The same thing happens when I click sign up. I'm using RC1 Update 2 BTW, will that have an impact on how the app works?

TIA!

Here's how my sign-in policy is set up.

untitled

wislon commented 8 years ago

@JCAnsus argh! ok, I understand. And I have absolutely no idea... sorry :wink:

pherbel commented 8 years ago

Hi Guys,

I will check my code again and I will update it to RTM version.

@JCAnsus I need to update my code and I will check the B2C. Maybe something changed

JCAnsus commented 8 years ago

@pherbel Thank you!

JCAnsus commented 8 years ago

@wislon No problem, thanks! :)

pherbel commented 8 years ago

I've just updated the code and it uses asp.net core RTM.

I tested with the SignIn and SignUp policy and it works well.

Note: The Profile link and with the Profile Edit policy is not working. I don't know exactly why. I will try to fix it.

wislon commented 8 years ago

@pherbel :+1: awesome! thank you! :)