İşte yaptığım şey.
Ev denetleyicisinden [Authorize]
özniteliğini kaldırın.
self[options.bindingMemberName] = ko.computed(function() {
if (!dataModel.getAccessToken()) {
// The following code looks for a fragment in the URL to get the access token which will be
// used to call the protected Web API resource
var fragment = common.getFragment();
if (fragment.access_token) {
// returning with access token, restore old hash, or at least hide token
window.location.hash = fragment.state || '';
dataModel.setAccessToken(fragment.access_token);
} else {
// no token - so bounce to Authorize endpoint in AccountController to sign in or register
window.location = "/Account/Authorize?client_id=web&response_type=token&state=" + encodeURIComponent(window.location.hash);
}
}
return self.Views[options.name];
});
Bu giriş ekranına yönlendirileceksiniz bölüm, bu yüzden dışarı veya if
bloğu kaldırmak:
Sonra
app.viewmodel.js
içinde bunu göreceksiniz. İsterseniz
app.datamodel.js
'a gidebilir ve
self.getAccessToken
'u kaldırabilir veya yorum yapabilirsiniz.
// Web API configuration and services
// Configure Web API to use only bearer token authentication.
config.SuppressDefaultHostAuthentication();
config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType));
web.config dosyasında olarak kabul ettiniz mi? burada: https://msdn.microsoft.com/en-us/library/aa291347(v=vs.71).aspx –
ibininja
Giriş noktasını istediğim görünüme nasıl ayarlayabilirim? – colobusgem
Bu http: // stackoverflow'u deneyin.com/questions/1333002/nasıl-set-in-başlangıç-sayfa-için-debugging-in-bir-as-net-mvc-uygulama, ya da maproute bakabiliriz (Yanılmıyorsa, bir en son VC/MVC kullanıyorum beri – ibininja