asp.net-mvc


Decorating class with Authorize assumes Office 365 login, instead of offering choice


I have configured my .NET Core app to allow authorization either through Office 365 (Open ID) or Google. If I go to the login page it shows both buttons and allows me to login using those.
But if I decorate a Controller Class with [Authorize] it sends me directly to our Office 365 login page instead of the page where they can select how they want to login. How do I get it to send the user to the login page instead so they can choose the method they want to use (Office 365, Google, Facebook, Twitter)?
Sounds like you need to set OpenIdConnectOptions.AutomaticChallenge = false;. It defaults to true because OIDC is more commonly used as the sole provider. It needs to be false if you want to have a login page where you choose between providers.
To achieve the same result in the latest update you should set:
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
AuthenticationMode = AuthenticationMode.Passive

Related Links

MVC ASP.NET search filter by int
How do I add placeholder text from the model into a MVC view?
Web site analytic application in the mvc application
mvc3 EditorFor/DisplayFor throws Collection was modified; enumeration operation may not execute
When I update ASP.NET MVC from 5.0 to 5.1, do I need to update the bindingRedirect to 5.1?
Set ClaimsAuthorizationManager in Code (MVC 5)
KendoUi MVC Grid passing parameter values
How exactly does CSS/Javascript minification and bundling work in MVC?
Roles Comparison in MVC
Route Id overrides Model.Id
View containing paging and Multiple Models
Asp.net Mvc Setting an attribute of any model which contains
WebApi (ApiController) vs OData (ODataController) in ASP.Net MVC
MVC architecture large action method on controller
Using .NET MVC/WebAPI, Is it possible to share an auth cookie between two projects of the same solution? If so, how?
Is it possible to send content body with get request in c# using HTTP 1.1

Categories

HOME
odoo-10
f#
tcl
azure-web-sites
sql-server-2012
google-cloud-dataproc
visual-studio-2012
http2
cross-domain
predictionio
silverlight
wso2ei
w3.css
pyfftw
durandal-2.0
rational
spring-restdocs
symbolic-math
x-sendfile
sql-server-2014-express
monads
true-type-fonts
stomp
subtotal
querydsl
chamilo-lms
increment
paypal-rest-sdk
confirm
ecmascript-4
procobol
angular2-seed
monogame
appdynamics
gulp-babel
sql-mode
ternary
libev
jce
android-touch-event
android-camera-intent
vs-2015-preview
sscanf
mink
file-import
groups
mars
mutation
google-api-ruby-client
pakyow
radix-sort
wand
uac
autopy
iphone-5
linegraph
access-log
sslv3
pencilblue
sql-server-ce-3.5
tortoisecvs
physx
sqlhelper
cellular-automata
data-quality
delphi-2009
disabled-input
modx-evolution
geometry-surface
memento
12factor
gigaspaces
teamcity-7.0
maven-bundle-plugin
sticky-footer
b-method
ondraw
gemstone
springboard
mate
jtemplates
nscollectionviewitem
android-searchmanager
xquery-update
sloc
utility
dynamic-websites
iphone-sdk-3.1

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App