alenny / angular2-adal Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Running Gulp build
reports adal
package is not found: it is not declared in typings global definition.
When reading up on Adal, the documentation says that it will intercept all xhr calls and add an authentication header if necessary. Is this also working in the Angular 2 solution? I am trying to make a call to an external web api, and I cannot see any auth header in my request. Please inform me if there are any additional steps that I need to take. (My spa is working, and I am able to get the authentication working for that, but when I try to make a call to another web api, I get 401)
Regards
Magnus
I've tried several approches...
this.adalService.acquireToken('resource');
this.adalService.acquireToken('resource')();
this.adalService.acquireToken('resource')().subscribe(s => console.log(s));
var acquireTokenFn = this.adalService.acquireToken('resource')
var result = acquireTokenFn( (token) => {
console.log(token);
});
result.subscribe( success => { console.log(success) } );
but none seem to give me the token... Please help :)
I cloned the whole repo, and had run the commands
npm install
gulp
but get below errors:
src/services/adal.service.ts(4,26): error TS2307: Cannot find module 'adal'.
src/services/adal.service.ts(10,26): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(18,32): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(40,26): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(89,34): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(90,58): error TS2503: Cannot find namespace 'adal'.
src/services/adal.service.ts(91,69): error TS2503: Cannot find namespace 'adal'.
I have an Angular 2 application that is able to login with Azure Active Directory, the problem is the token expires after an hour of use.
It appears to be an issue with adal.js where it tries to load login.windows.com in an iframe or something similar which doesn't work because of x-frame-options DENY.
Is this is a common issue?
Getting stuck on the following error using the Angular2 Final version:
Error: TypeError: core_1.provide is not a function
at Object.eval (http://localhost:5555/node_modules/angular2-adal/core.js:15:12)
at eval (http://localhost:5555/node_modules/angular2-adal/core.js:20:4)
at eval (http://localhost:5555/node_modules/angular2-adal/core.js:21:3)
at Object.eval (http://localhost:5555/app/shared/trip/trip.service.js:15:14)
Evaluating http://localhost:5555/node_modules/angular2-adal/core.js
Evaluating http://localhost:5555/app/shared/trip/trip.service.js
Evaluating http://localhost:5555/app/shared/trip/index.js
Evaluating http://localhost:5555/app/shared/index.js
Evaluating http://localhost:5555/app/app.component.js
Evaluating http://localhost:5555/app/app.module.js
Evaluating http://localhost:5555/app/main.js
Error loading http://localhost:5555/app/main.js "Report this error at https://github.com/mgechev/angular2-seed/issues"(anonymous function) @ (index):110ZoneDelegate.invoke @ zone.js?1474011477542:192Zone.run @ zone.js?1474011477542:85(anonymous function) @ zone.js?1474011477542:451ZoneDelegate.invokeTask @ zone.js?1474011477542:225Zone.runTask @ zone.js?1474011477542:125drainMicroTaskQueue @ zone.js?1474011477542:357ZoneTask.invoke @ zone.js?1474011477542:297
Anyone got any suggestions?
Is it possible to set up angular2-adal to be multitenant-enabled via an url parameter?
Trying to integrate with the official angular cli but I'm facing the following issue:
cannot find module "adal"
Does anyone succeeded integrating it with angular-cli?
It works using the old "@angular/router-deprecated" module, but it doesn't work when using the new "@angular/router". Basically, with the new router module, after the user successfully authenticates the angular2-adal appears to interpret the returned token from Azure AD as a route which obviously errors out with a no match route error. Is there a way to make this work with the new route module? If not, is there a work around for this? I don't want to create my app using the old route library which doesn't look like it'll stay around much longer.
This issue is happening in angular 4.0.0.0
Descriptive Error:
Error: (SystemJS) core_1.provide is not a function
TypeError: core_1.provide is not a function
at Object.eval (http://localhost:55177/node_modules/angular2-adal/core.js:15:12)
at eval (http://localhost:55177/node_modules/angular2-adal/core.js:20:4)
at eval (http://localhost:55177/node_modules/angular2-adal/core.js:21:3)
at eval ()
Evaluating http://localhost:55177/node_modules/angular2-adal/core.js
Evaluating http://localhost:55177/src/app/app.component.js
Evaluating http://localhost:55177/src/app/app.module.js
Evaluating http://localhost:55177/src/main.js
Error loading http://localhost:55177/src/main.js
at Object.eval (http://localhost:55177/node_modules/angular2-adal/core.js:15:12)
at eval (http://localhost:55177/node_modules/angular2-adal/core.js:20:4)
at eval (http://localhost:55177/node_modules/angular2-adal/core.js:21:3)
at eval ()
Evaluating http://localhost:55177/node_modules/angular2-adal/core.js
Evaluating http://localhost:55177/src/app/app.component.js
Evaluating http://localhost:55177/src/app/app.module.js
Evaluating http://localhost:55177/src/main.js
Error loading http://localhost:55177/src/main.js
Currently in this approach the token is not automatically refreshed. The token get expires after 1 hour.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.