ui-calendar
ui-calendar copied to clipboard
eventSource is a restfull service with JWT token
my calendar has to get data from a internal service with JWT token requirement. is there any method to custom http request header? E,g
$scope.eventSource = {
url: $scope.dataBaseServiceUrl + 'calendar',
className: 'gcal-event', // an option!
currentTimezone: 'UTC', // an option!,
cache: false,
// header:{Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6Ik....'}
};
Hi razor9999, In order to add the access_token in the header you can try to do as below:
eventSources: [
{
url: '/api/calendar',
headers: {
'Authorization': 'Bearer' + $rootScope.access_token
}
}
]
Don't forget the single whitespace between 'Bearer' and the token.
eventSources: [ { url: '/api/calendario', headers: { 'Authorization': 'Bearer ' + jwtoken } } ],
Hello, I tried to use your example with a laravel application. My route is defined in middleware that requires authentication. If you remove the request in api works correctly