alenny / angular2-adal-example Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm using TypeScript version 1.8.10 and trying to compile the example project, but I get the following error
Module not found: Error: Cannot resolve module 'adal' in C:\Projects\AzureAD\WebAppsCh5\WebAppsCh5Angular2\node_modules\angular2-adal\services @ ./~/angular2-adal/services/adal.service.js 20:14-29
I added the "adal" reference to the typings.json file suggested in another issue:
"adal": "github:DefinitelyTyped/DefinitelyTyped/adal-angular/adal.d.ts#53347571e6f44ed9a961b569bb81893fde4789c1",
Unfortunately, that didn't fix the error either. Do I need to npm install
the ADAL.js package?
Got above error running sample gulp file, here is the npm log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
1 verbose cli 'C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files (x86)\nodejs\node.exe
5 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
6 info prebuild [email protected]
7 info build [email protected]
8 verbose unsafe-perm in lifecycle true
9 info [email protected] Failed to exec build script
10 verbose stack Error: [email protected] build:tsc
10 verbose stack Exit status 2
10 verbose stack at EventEmitter. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1015:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
11 verbose pkgid [email protected]
12 verbose cwd C:\Users\IsaacLevin\Downloads\angular2-adal-example-master
13 error Windows_NT 6.3.9600
14 error argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
15 error node v0.12.2
16 error npm v2.7.4
17 error code ELIFECYCLE
18 error [email protected] build:tsc
18 error Exit status 2
19 error Failed at the [email protected] build script 'tsc'.
19 error This is most likely a problem with the angular2-azure-ad package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error tsc
19 error You can get their info via:
19 error npm owner ls angular2-azure-ad
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]
Hi,
I am trying to integrate this package with a brand new Angular 2 app (using "@angular/core": "^4.1.2"
in package.json). I'm using webpack to do the build instead of SystemJs.
Local dev build with ng build
and ng serve
is working fine but prod build with ng build --prod --aot
fails with the following error.
ERROR in Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/core/index.d.ts, resolving symbol BrowserXhr in
c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/http/src/backends/browser_xhr.d.ts, resolving symbol BrowserXhr in c:/path-to-my-project/node_modules/ng2-adal/node_modules/@angular/http/src/backends/browser_xhr.d.ts
Is this because the package is built using older Angular version? Is there a way I can get around it or fix it?
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
Not really an issue, this example works
Is there to integrate this into an Ionic2 app. The issue I'm having is that the token from the browser does not get sent through to the app.
adal lib should handle auto renew the token for every hour. But, after one hour token getting expired and not doing auto-renew process.
Is this the correct usage of this function? I seem to be getting an error " Build: Property 'subscribe' does not exist on type '() => Observable<{}>'"
this.adalService.acquireToken("http://whatever")
.subscribe(
data => {
alert(data);
},
error => {
alert('error!');
}
);
I'm unable to run the sample.
GET /lib/adal-angular/lib/adal.js 404 (Not Found)
I changed the map path in systemjs.config.js to get around the issue:
Was:
'adal': 'lib/adal-angular/lib'
Edited:
'adal': 'lib/angular2-adal/node_modules/adal-angular/lib'
The example doesn't appear to work.
node_modules/angular2-adal/services/adal.service.d.ts(13,25): error TS2503: Cannot find namespace 'adal'.
Edit:
I fixed it by adding "adal": "github:DefinitelyTyped/DefinitelyTyped/adal-angular/adal.d.ts#53347571e6f44ed9a961b569bb81893fde4789c1" to typings.json
I did the following command to fix the build error:
typings install --save --global --source dt adal-angular/adal
But on running the app, I see the Loading message never goes away.. On the SystemJS output, I see adal.js not found with 404 error.
Hi,
I need to validate the token in a rest service in java that's consumed by a logged in user, do you know how can I validate it?
thanks.
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.