-
Notifications
You must be signed in to change notification settings - Fork 65
Fixed build error and AcquireToken function #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sureshchahal
wants to merge
101
commits into
alenny:master
Choose a base branch
from
sureshchahal:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
b462206
Fixed build error and acquire token function
sureshchahal 7f38f4b
allback when access token is received
sureshchahal 18a90f0
Handled error during acquire token
sureshchahal e76607e
Added Http extension for acquring token for CORS API
sureshchahal 0ac499e
Fixed complie errors
sureshchahal ee0cd13
AuthHttp can take RequestOptions in http requests
jdkb123 2a86e4d
Merge pull request #1 from jdkb123/patch-1
sureshchahal dcdce45
Update README.md
sureshchahal 9cdb7b3
Only check for authenticated user only if backend API is configured i…
sureshchahal eb2bf16
Provided Put, Patch and Head methods
sureshchahal f661f40
Released as separate package ng2-adal
sureshchahal b418c30
body was ignored in Put, Post and Patch
fume 7b302e3
Merge pull request #2 from fume/master
sureshchahal 7ddc85a
upgraded to angular2
sureshchahal f667c85
Merge branch 'master' of https://github.com/sureshchahal/angular2-adal
sureshchahal 1febba9
upgraded version for publish
sureshchahal 31a0429
Fixed for Angular2
sureshchahal 6a9ea40
removed debugger
fume 20354d0
Merge pull request #7 from fume/issue-6
sureshchahal 6fce6f8
exposing via NgModule
fume 207a465
Added skipLibCheck to tsconfig
fume 0c229cc
Merge branch 'master' into issue-8
fume e2a654c
Merge pull request #9 from fume/issue-8
sureshchahal 23ec861
Upgraded version after modules
sureshchahal f6abafe
Upgraded to 0.2.5
sureshchahal 9eeb7f0
Typo in imports. adal.service and authHttp.service do not work on Ubuntu
pkalinnikov 89bdd11
Merge pull request #14 from pkalinnikov/master
sureshchahal 6749aef
Renamed adal to adal-angular to let webpack build run without aliases
d173544
Fixed webpack warnings "There is another module with an equal name wh…
26e2d81
Updated gulp-typescript to use TypeScript 2.x and fix syntax errors d…
6f5ecc1
Merge pull request #16 from DarkXaHTeP/master
sureshchahal 4a76078
Replaced typings with predefined typescript types for es2015 and brow…
2b993a2
Updated angular-adal
6c5fb1d
Removed postinstall for typings
58ae823
Removed parts of adal typing in src/adal-angular that are not needed …
79feaa6
Merge pull request #18 from DarkXaHTeP/master
sureshchahal 64d07fe
Updated version to 0.2.6
07ab219
Update README.md
sureshchahal bc0306d
fixing issue #19 and #20
619733b
Fixed issue with 'this' not referencing AdalService as expected. Also…
cbrianball 7c789e8
Merge pull request #27 from cbrianball/bug/AdalService.acquireToken-o…
sureshchahal 6a388ab
acquireToken(resource) now returns Observable<string>, so Typescript …
corfor 713ddc3
fixed sendRequest(url, options) to return Observable<string>
corfor 9c692de
fixed runtime bug found by @jbarr33
corfor 5dcafa5
Merge branch 'develop'
corfor 78ceb6b
fixed runtime bug found by @jbarr33
corfor a55f65e
Expose ability to refresh the data from cache
mkelan 3b52a61
Merge pull request #30 from corfor/master
sureshchahal 5aa14cb
Merged and published latest pull
dae85b8
Merge pull request #35 from mazhisai/master
sureshchahal 9209b21
Updated version after publishing 0.3.0 version to npm
da9ed22
Update authHttp.service.ts
Cyberdada 4242c5c
changed import from rxjs
Cyberdada 1f18d01
Merge pull request #39 from Cyberdada/master
sureshchahal 8f660e8
Added check for id_token to fix the issue where token refreshes in th…
jjbrunton c4058d8
Merge pull request #1 from Dootrix/bug/token-refresh
cargowire 78e2047
Merge pull request #45 from Dootrix/master
sureshchahal f5c66ed
Reverted pull from Cyberdada , it broke build
d164546
Update adal.service.ts
Cyberdada f3275ca
Update authHttp.service.ts
Cyberdada 5092987
Update core.ts
Cyberdada a0eba5f
Update package.json
Cyberdada 4fc2c47
Update bundle.js
Cyberdada 35015ec
Update authHttp.service.ts
Cyberdada 3be32db
Merge branch 'master' into master
sureshchahal 5c2ec5e
Merge pull request #48 from Cyberdada/master
sureshchahal 5389051
Separate repo for ng2 and ng4
sureshchahal d5b8ca1
Published Angular 4 version
1323541
Don´t log errors to console
ericivarsson 4c1ba8c
Merge pull request #1 from sureshchahal/master
rjwijnen b95e6a5
Fix Throw error in AuthHttp.service
9a6b8f6
Merge pull request #53 from ericivarsson/patch-1
sureshchahal 75dcf0f
Merge pull request #54 from rjwijnen/master
sureshchahal b63513d
Fix reference to this in getUser error
aciccarello 2c94172
Eliminate dead code in adal.service
aciccarello a0cc0e6
Fix Typescript >= 2.4.1 compilation error described on issue #64
nelsonmorais 9be3a23
Merge pull request #61 from aciccarello/patch-3
sureshchahal 67f3375
Merge pull request #63 from aciccarello/patch-4
sureshchahal ab2629c
Merge branch 'master' into patch-1
sureshchahal 9774374
Merge pull request #65 from nelsonmorais/patch-1
sureshchahal b8bbbe6
Updated package version
b52db0f
Update README.md
sureshchahal 0699d98
Update README.md
sureshchahal e2904fa
Update package.json
sureshchahal f5a913e
Update readme
c884fde
Merge pull request #69 from claudiuconstantin/patch-1
sureshchahal d04f513
Updated README with the new example URL
ranveeraggarwal 266e93e
Merge pull request #70 from ranveeraggarwal/update-example-url
sureshchahal f535eb7
Merge pull request #2 from sureshchahal/master
rjwijnen 31da0c1
Update package.json to angular 5
45846df
Update add interceptor instead of AuthHttp
010ff5a
Updated Readme
46cfd83
this was undefined in getUser error handler
wvanderdeijl 046e977
Add authenticationStatus observable to OAuthData
0a738c7
Make authentication status observable on oauthData
5559c1d
remove package lock
29edbb6
Remove handle error since it is not doing anything
3698cd5
Add observable.throw
4185a53
Merge pull request #84 from straach/merge_back_to_fork_origin
sureshchahal dfbc718
Merge pull request #80 from wvanderdeijl/getUser-this-undefined
sureshchahal 33ef768
Merge pull request #77 from rjwijnen/master
sureshchahal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| declare module 'adal' { | ||
| export function inject(config: adal.Config): adal.AuthenticationContext; | ||
| } | ||
|
|
||
| declare namespace adal { | ||
|
|
||
| interface Config { | ||
| clientId: string, | ||
| anonymousEndpoints?: any, | ||
| cacheLocation?: string, | ||
| correlationId?: string, | ||
| displayCall?: (urlNavigate: string) => any, | ||
| endpoints?: any, // If you need to send CORS api requests. | ||
| expireOffsetSeconds?: number, | ||
| extraQueryParameter?: string, | ||
| instance?: string, | ||
| localLoginUrl?: string, | ||
| loginResource?: string, | ||
| postLogoutRedirectUri?: string, | ||
| redirectUri?: string, | ||
| state?: string, | ||
| tenant?: string | ||
| } | ||
|
|
||
| interface User { | ||
| userName: string, | ||
| profile?: any | ||
| } | ||
|
|
||
| interface RequestInfo { | ||
| valid: boolean, | ||
| parameters: any, | ||
| stateMatch: boolean, | ||
| stateResponse: string, | ||
| requestType: string | ||
| } | ||
|
|
||
| interface AuthenticationContextStatic { | ||
| new (config: Config): AuthenticationContext; | ||
| } | ||
|
|
||
| interface AuthenticationContext { | ||
|
|
||
| REQUEST_TYPE: { | ||
| LOGIN: string, | ||
| RENEW_TOKEN: string, | ||
| UNKNOWN: string | ||
| }; | ||
| instance: string; | ||
| config: Config; | ||
|
|
||
| /** | ||
| * Gets initial Idtoken for the app backend | ||
| * Saves the resulting Idtoken in localStorage. | ||
| */ | ||
| login(): void; | ||
| loginInProgress(): boolean; | ||
|
|
||
| /** | ||
| * Gets token for the specified resource from local storage cache | ||
| * @param {string} resource A URI that identifies the resource for which the token is valid. | ||
| * @returns {string} token if exists and not expired or null | ||
| */ | ||
| getCachedToken(resource: string): string; | ||
|
|
||
| /** | ||
| * Retrieves and parse idToken from localstorage | ||
| * @returns {User} user object | ||
| */ | ||
| getCachedUser(): User; | ||
|
|
||
| registerCallback(expectedState: string, resource: string, callback: (message: string, token: string) => any): void; | ||
|
|
||
| /** | ||
| * Acquire token from cache if not expired and available. Acquires token from iframe if expired. | ||
| * @param {string} resource ResourceUri identifying the target resource | ||
| * @param {requestCallback} callback | ||
| */ | ||
| acquireToken(resource: string, callback: (message: string, token: string) => any): void; | ||
|
|
||
| /** | ||
| * Redirect the Browser to Azure AD Authorization endpoint | ||
| * @param {string} urlNavigate The authorization request url | ||
| */ | ||
| promptUser(urlNavigate: string): void; | ||
|
|
||
| /** | ||
| * Clear cache items. | ||
| */ | ||
| clearCache(): void; | ||
|
|
||
| /** | ||
| * Clear cache items for a resource. | ||
| */ | ||
| clearCacheForResource(resource: string): void; | ||
|
|
||
| /** | ||
| * Logout user will redirect page to logout endpoint. | ||
| * After logout, it will redirect to post_logout page if provided. | ||
| */ | ||
| logOut(): void; | ||
|
|
||
| /** | ||
| * Gets a user profile | ||
| * @param {requestCallback} callback - The callback that handles the response. | ||
| */ | ||
| getUser(callback: (message: string, user?: User) => any): void; | ||
|
|
||
| /** | ||
| * Checks if hash contains access token or id token or error_description | ||
| * @param {string} hash - Hash passed from redirect page | ||
| * @returns {Boolean} | ||
| */ | ||
| isCallback(hash: string): boolean; | ||
|
|
||
| /** | ||
| * Gets login error | ||
| * @returns {string} error message related to login | ||
| */ | ||
| getLoginError(): string; | ||
|
|
||
| /** | ||
| * Gets requestInfo from given hash. | ||
| * @returns {string} error message related to login | ||
| */ | ||
| getRequestInfo(hash: string): RequestInfo; | ||
|
|
||
| /** | ||
| * Saves token from hash that is received from redirect. | ||
| */ | ||
| saveTokenFromHash(requestInfo: RequestInfo): void; | ||
|
|
||
| /** | ||
| * Gets resource for given endpoint if mapping is provided with config. | ||
| * @param {string} endpoint - API endpoint | ||
| * @returns {string} resource for this API endpoint | ||
| */ | ||
| getResourceForEndpoint(endpoint: string): string; | ||
|
|
||
| handleWindowCallback(): void; | ||
|
|
||
| callback : any; | ||
|
|
||
| _getItem : any; | ||
|
|
||
| _renewFailed : any; | ||
|
|
||
| CONSTANTS : any; | ||
|
|
||
| log(level: number, message: string, error: any): void; | ||
| error(message: string, error: any): void; | ||
| warn(message: string): void; | ||
| info(message: string): void; | ||
| verbose(message: string): void; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| interface Window { | ||
| AuthenticationContext : any; | ||
| callBackMappedToRenewStates : any; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| export {AdalService} from './services/adal.service'; | ||
| export {OAuthData} from './services/oauthdata.model'; | ||
| export {OAuthData} from './services/oauthdata.model'; | ||
| export {AuthHttp} from './services/authHttp.service' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the below line
return Observable.bindCallback(function (cb: (u: adal.User) => void) {
to
return Observable.bindCallback((cb: (u: adal.User) => void) => {
as the ts compiler is behaving weirdly with first format and creating a JS of
AdalService.prototype.getUser = function () {
return Observable_1.Observable.bindCallback(function (cb) {
this.adalContext.getUser(function (error, user) {
instead of this
which is failing with null reference at this.adalContext.something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated