Closed gunduzemreozer closed 3 years ago
I searched angular V1 and found solution :) I want to share if someone needs this.
You can add app.config part to the LocalizationAdmin/app/app.js file like below. I added to the place before of other app.config part.
app.config(["$httpProvider", function ($httpProvider) {
$httpProvider.defaults.headers.common["Accept-Language"] = "en-US";
var token = localStorage.getItem('token'); // you can put token from cookie or other place you store.
if (token) {
$httpProvider.defaults.headers.common["Authorization"] = "Bearer " + token;
}
}])
`
Hello.
I am a Vue developer and I don't know angular unfortunately. I saw that there is a solution to protect /localizationadmin ui like below.
`services.AddWestwindGlobalization(opt => {
// the default settings comme from DbResourceConfiguration.json if exists // Customize opt with any customizations here...
});`
But I use JwtBearer Authentication in my project. I am sending jwt token at request header for authorized end points. For that reason, I don't know how to implement token authorization for HttpContext.User.Identity.IsAuthenticated property. Is there any way to pass token in header at angular side. Or is there any alternative solution to make localizationadmin secure. I'm waiting your suggestions.