I configured the state which contains url with url parameters like this: url:route/:id1/:id2:id3
with ADAL js. When I hit url with route/1/2/3
, after login, I am redirected to route/:id1/:id2/:id3?id1=1&id2=2&id3=3
instead of route/1/2/3
.
I investigated further and in adal-angular.js file, we are setting browser url with $location.url().search(jsonParameters)
where jsonParameters
is json object with value {id1:1, id2:2, id3:3}
which is causing the url malformation.
Can you guys point me in correct direction on how to solve this issue and redirect to proper url?
Edit: Adding code sample
I have configured the AAD route as specified below:
$stateProvider
.state('State1', {
templateUrl: getViewUrl('viewUrl'),
controller: 'homeController',
controllerAs: 'home',
url: '/route/:id1/:id2/:id3',
requireADLogin: true
})
I am initializing the adal sevice provider in following way:
$locationProvider.html5Mode(false);
var endpoints = {}
endpoints[EnvironmentConfig.url1] = EnvironmentConfig.url1;
endpoints[EnvironmentConfig.url2] = EnvironmentConfig.url2;
adalAuthenticationServiceProvider.init(
{
instance: EnvironmentConfig.aadUrl, // 'https://login.microsoftonline.com/',
tenant: EnvironmentConfig.tenant, // 'microsoft.onmicrosoft.com',
clientId: EnvironmentConfig.clientId,
endpoints: endpoints,
loginResource: EnvironmentConfig.breServiceADUrl
//cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost.
}, $httpProvider);
Thanks.
requireADLogin: true
via the$routeProvider
but still not able to reproduce this issue. Did you mix the ui-router and ngRoute? It is helpful if you can provide a code sample to reproduce this issue.