├── docs └── images │ ├── oauth2-logo.png │ └── nativescript-oauth-logo.png ├── .gitignore ├── demo ├── app │ ├── App_Resources │ │ ├── iOS │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── icon-29.png │ │ │ │ │ ├── icon-40.png │ │ │ │ │ ├── icon-50.png │ │ │ │ │ ├── icon-57.png │ │ │ │ │ ├── icon-72.png │ │ │ │ │ ├── icon-76.png │ │ │ │ │ ├── icon-29@2x.png │ │ │ │ │ ├── icon-29@3x.png │ │ │ │ │ ├── icon-40@2x.png │ │ │ │ │ ├── icon-40@3x.png │ │ │ │ │ ├── icon-50@2x.png │ │ │ │ │ ├── icon-57@2x.png │ │ │ │ │ ├── icon-60@2x.png │ │ │ │ │ ├── icon-60@3x.png │ │ │ │ │ ├── icon-72@2x.png │ │ │ │ │ ├── icon-76@2x.png │ │ │ │ │ ├── icon-83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchImage.launchimage │ │ │ │ │ ├── Default.png │ │ │ │ │ ├── Default@2x.png │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ ├── Default-667h@2x.png │ │ │ │ │ ├── Default-736h@3x.png │ │ │ │ │ ├── Default-Landscape.png │ │ │ │ │ ├── Default-Portrait.png │ │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchScreen.Center.imageset │ │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.AspectFill.imageset │ │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── build.xcconfig │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ └── Android │ │ │ ├── values-v21 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── drawable-hdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-ldpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-mdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── drawable-nodpi │ │ │ └── splash_screen.xml │ │ │ ├── app.gradle │ │ │ └── AndroidManifest.xml │ ├── package.json │ ├── bundle-config.ts │ ├── app.css │ ├── README.md │ ├── main-view-model.ts │ ├── app.ts │ ├── main-page.ts │ └── main-page.xml ├── typings │ ├── url.d.ts │ └── querystring.d.ts ├── tsconfig.json ├── .vscode │ └── launch.json └── package.json ├── demo-angular ├── app │ ├── App_Resources │ │ ├── iOS │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── icon-29.png │ │ │ │ │ ├── icon-40.png │ │ │ │ │ ├── icon-50.png │ │ │ │ │ ├── icon-57.png │ │ │ │ │ ├── icon-72.png │ │ │ │ │ ├── icon-76.png │ │ │ │ │ ├── icon-29@2x.png │ │ │ │ │ ├── icon-29@3x.png │ │ │ │ │ ├── icon-40@2x.png │ │ │ │ │ ├── icon-40@3x.png │ │ │ │ │ ├── icon-50@2x.png │ │ │ │ │ ├── icon-57@2x.png │ │ │ │ │ ├── icon-60@2x.png │ │ │ │ │ ├── icon-60@3x.png │ │ │ │ │ ├── icon-72@2x.png │ │ │ │ │ ├── icon-76@2x.png │ │ │ │ │ ├── icon-83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchImage.launchimage │ │ │ │ │ ├── Default.png │ │ │ │ │ ├── Default@2x.png │ │ │ │ │ ├── Default-568h@2x.png │ │ │ │ │ ├── Default-667h@2x.png │ │ │ │ │ ├── Default-736h@3x.png │ │ │ │ │ ├── Default-Portrait.png │ │ │ │ │ ├── Default-Landscape.png │ │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── LaunchScreen.Center.imageset │ │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchScreen.AspectFill.imageset │ │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ │ └── Contents.json │ │ │ ├── build.xcconfig │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ └── Android │ │ │ ├── values-v21 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── drawable-hdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-ldpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-mdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── icon.png │ │ │ ├── logo.png │ │ │ └── background.png │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ ├── drawable-nodpi │ │ │ └── splash_screen.xml │ │ │ ├── app.gradle │ │ │ └── AndroidManifest.xml │ ├── app.component.html │ ├── main.aot.ts │ ├── app.module.ts │ ├── app.css │ ├── app.component.ts │ ├── package.json │ └── main.ts ├── lib │ └── iOS │ │ └── TNSWidgets.framework │ │ ├── Info.plist │ │ ├── TNSWidgets │ │ ├── Modules │ │ └── module.modulemap │ │ └── Headers │ │ ├── TNSLabel.h │ │ ├── TNSWidgets.h │ │ └── UIImage+TNSBlocks.h ├── tsconfig.json └── package.json ├── .npmignore ├── typings ├── url.d.ts └── querystring.d.ts ├── tns-oauth-webview-helper.d.ts ├── references.d.ts ├── auth-helper-custom.ts ├── tns-oauth-utils.ts ├── auth-helper-google.ts ├── auth-helper-office365.ts ├── auth-helper-facebook.ts ├── LICENSE ├── index.d.ts ├── auth-helper-linkedin.ts ├── auth-helper-uaa.ts ├── tsconfig.json ├── tns-oauth-token-cache.ts ├── tns-oauth-page-provider.ts ├── tns-oauth-webview.ts ├── package.json ├── tns-oauth-interfaces.d.ts ├── auth-helper-salesforce.ts ├── auth-helper.ts ├── tns-oauth-webview-helper.ios.ts ├── tns-oauth-webview-helper.android.ts ├── index.ts ├── README.md └── tns-oauth.ts /docs/images/oauth2-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/docs/images/oauth2-logo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.js.map 3 | *.log 4 | demo*/app/*.js 5 | demo*/*.d.ts 6 | demo*/platforms 7 | demo*/node_modules 8 | node_modules -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /docs/images/nativescript-oauth-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/docs/images/nativescript-oauth-logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/lib/iOS/TNSWidgets.framework/Info.plist -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/TNSWidgets: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/lib/iOS/TNSWidgets.framework/TNSWidgets -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "android": { 3 | "v8Flags": "--expose_gc" 4 | }, 5 | "main": "app.js", 6 | "name": "tns-template-hello-world-ts", 7 | "version": "2.5.0" 8 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | demo-angular/ 3 | node_modules/ 4 | hooks/ 5 | *.log 6 | *.ts 7 | *.js.map 8 | tsconfig.json 9 | 10 | !index.d.ts 11 | !tns-oauth-interfaces.d.ts 12 | !*.js 13 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TNSWidgets { 2 | umbrella header "TNSWidgets.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/Android/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /typings/url.d.ts: -------------------------------------------------------------------------------- 1 | 2 | declare module "url" { 3 | export function Url(): void; 4 | export function parse(url: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): any; 5 | } 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/typings/url.d.ts: -------------------------------------------------------------------------------- 1 | 2 | declare module "url" { 3 | export function Url(): void; 4 | export function parse(url: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): any; 5 | } 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo-angular/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo/app/bundle-config.ts: -------------------------------------------------------------------------------- 1 | if ((global).TNS_WEBPACK) { 2 | //registers tns-core-modules UI framework modules 3 | require("bundle-entry-points"); 4 | 5 | //register application modules 6 | global.registerModule("main-page", () => require("./main-page")); 7 | } 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth/HEAD/demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /tns-oauth-webview-helper.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { WebView } from 'ui/web-view'; 4 | 5 | export declare class TnsOAuthWebViewHelper { 6 | constructor(); 7 | 8 | static initWithWebViewAndIntercept(wv: WebView, checkCodeIntercept); 9 | } 10 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-angular/app/main.aot.ts: -------------------------------------------------------------------------------- 1 | // this import should be first in order to load some required settings (like globals and reflect-metadata) 2 | import { platformNativeScript } from "nativescript-angular/platform-static"; 3 | 4 | import { AppModuleNgFactory } from "./app.module.ngfactory"; 5 | 6 | platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); 7 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/Headers/TNSLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // TNSLabel.h 3 | // TNSWidgets 4 | // 5 | // Created by Hristo Hristov on 6/9/16. 6 | // Copyright © 2016 Telerik A D. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TNSLabel : UILabel 12 | 13 | @property(nonatomic) UIEdgeInsets padding; 14 | @property(nonatomic) UIEdgeInsets borderThickness; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // 5 | /// 6 | /// 7 | /// 8 | -------------------------------------------------------------------------------- /demo-angular/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; 2 | import { NativeScriptModule } from "nativescript-angular/nativescript.module"; 3 | 4 | import { AppComponent } from "./app.component"; 5 | 6 | @NgModule({ 7 | declarations: [AppComponent], 8 | bootstrap: [AppComponent], 9 | imports: [NativeScriptModule], 10 | schemas: [NO_ERRORS_SCHEMA] 11 | }) 12 | export class AppModule { } 13 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.demowtf" 12 | } 13 | aaptOptions { 14 | additionalParameters "--no-version-vectors" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-Center.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-Center@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchScreen-AspectFill.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchScreen-AspectFill@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | // You can add custom settings here 2 | // for example you can uncomment the following line to force distribution code signing 3 | // CODE_SIGN_IDENTITY = iPhone Distribution 4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html 5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID; 6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 8 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | applicationId = "org.nativescript.demoangular" 12 | 13 | //override supported platforms 14 | // ndk { 15 | // abiFilters.clear() 16 | // abiFilters "armeabi-v7a" 17 | // } 18 | 19 | } 20 | aaptOptions { 21 | additionalParameters "--no-version-vectors" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "experimentalDecorators": true, 6 | "emitDecoratorMetadata": true, 7 | "noEmitHelpers": true, 8 | "noEmitOnError": true, 9 | "lib": [ 10 | "es6", 11 | "dom" 12 | ], 13 | "baseUrl": ".", 14 | "paths": { 15 | "*": [ 16 | "./node_modules/tns-core-modules/*", 17 | "./node_modules/*" 18 | ] 19 | } 20 | }, 21 | "exclude": [ 22 | "node_modules", 23 | "platforms", 24 | "**/*.aot.ts" 25 | ] 26 | } -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/Headers/TNSWidgets.h: -------------------------------------------------------------------------------- 1 | // 2 | // TNSWidgets.h 3 | // TNSWidgets 4 | // 5 | // Created by Panayot Cankov on 4/27/16. 6 | // Copyright © 2016 Telerik A D. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for TNSWidgets. 12 | FOUNDATION_EXPORT double TNSWidgetsVersionNumber; 13 | 14 | //! Project version string for TNSWidgets. 15 | FOUNDATION_EXPORT const unsigned char TNSWidgetsVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "UIImage+TNSBlocks.h" 20 | #import "TNSLabel.h" 21 | -------------------------------------------------------------------------------- /demo-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "experimentalDecorators": true, 6 | "emitDecoratorMetadata": true, 7 | "noEmitHelpers": true, 8 | "noEmitOnError": true, 9 | "lib": [ 10 | "es6", 11 | "dom", 12 | "es2015.iterable" 13 | ], 14 | "baseUrl": ".", 15 | "paths": { 16 | "*": [ 17 | "./node_modules/tns-core-modules/*", 18 | "./node_modules/*" 19 | ] 20 | } 21 | }, 22 | "exclude": [ 23 | "node_modules", 24 | "platforms", 25 | "**/*.aot.ts" 26 | ] 27 | } -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.css file is where you place CSS rules that 3 | you would like to apply to your entire application. Check out 4 | http://docs.nativescript.org/ui/styling for a full list of the CSS 5 | selectors and properties you can use to style UI components. 6 | 7 | /* 8 | For example, the following CSS rule changes the font size of all UI 9 | components that have the btn class name. 10 | */ 11 | .btn { 12 | font-size: 18; 13 | } 14 | 15 | /* 16 | In many cases you may want to use the NativeScript core theme instead 17 | of writing your own CSS rules. For a full list of class names in the theme 18 | refer to http://docs.nativescript.org/ui/theme. 19 | */ 20 | @import 'nativescript-theme-core/css/core.light.css'; 21 | -------------------------------------------------------------------------------- /demo-angular/app/app.css: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.css file is where you place CSS rules that 3 | you would like to apply to your entire application. Check out 4 | http://docs.nativescript.org/ui/styling for a full list of the CSS 5 | selectors and properties you can use to style UI components. 6 | 7 | /* 8 | For example, the following CSS rule changes the font size of all UI 9 | components that have the btn class name. 10 | */ 11 | .btn { 12 | font-size: 18; 13 | } 14 | 15 | /* 16 | In many cases you may want to use the NativeScript core theme instead 17 | of writing your own CSS rules. For a full list of class names in the theme 18 | refer to http://docs.nativescript.org/ui/theme. 19 | */ 20 | @import 'nativescript-theme-core/css/core.light.css'; 21 | -------------------------------------------------------------------------------- /auth-helper-custom.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | export class AuthHelperCustom extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 8 | 9 | constructor( 10 | credentials: TnsOAuth.ITnsOAuthCredentials, 11 | private cookieDomains: Array, 12 | ) { 13 | super(); 14 | this.credentials = {} as any; 15 | Object.assign(this.credentials, credentials); 16 | this.credentials.scope = credentials.scope.replace(/ /g, '%20'); 17 | } 18 | 19 | public logout(successPage?: string): Promise { 20 | return this._logout(successPage, this.cookieDomains); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tns-oauth-utils.ts: -------------------------------------------------------------------------------- 1 | import { on, resumeEvent, suspendEvent } from 'tns-core-modules/application'; 2 | 3 | export function endsWith(str, suffix) { 4 | return str.indexOf(suffix, str.length - suffix.length) !== -1; 5 | } 6 | 7 | 8 | export function nsArrayToJSArray(a) { 9 | var arr = []; 10 | if ("undefined" !== typeof a) { 11 | var count = a.count; 12 | for (var i = 0; i < count; i++) { 13 | arr.push(a.objectAtIndex(i)); 14 | } 15 | } 16 | return arr; 17 | } 18 | 19 | export function newUUID(a?,b?){for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');return b} 20 | 21 | let appSuspending = false; 22 | on(suspendEvent, () => { appSuspending = true; }); 23 | on(resumeEvent, () => { appSuspending = false; }); 24 | 25 | export function isAppSuspending(): boolean { 26 | return appSuspending; 27 | } 28 | -------------------------------------------------------------------------------- /demo/app/README.md: -------------------------------------------------------------------------------- 1 | # NativeScript TypeScript Template 2 | 3 | This template creates a NativeScript app with the NativeScript hello world example, 4 | however, in this template the example is built with TypeScript. 5 | 6 | You can create a new app that uses this template with either the `--template` option. 7 | 8 | ``` 9 | tns create my-app-name --template tns-template-hello-world-ts 10 | ``` 11 | 12 | Or the `--tsc` shorthand. 13 | 14 | ``` 15 | tns create my-app-name --tsc 16 | ``` 17 | 18 | > Note: Both commands will create a new NativeScript app that uses the latest version of this template published to [npm] (https://www.npmjs.com/package/tns-template-hello-world-ts). 19 | 20 | If you want to create a new app that uses the source of the template from the `master` branch, you can execute the following: 21 | 22 | ``` 23 | tns create my-app-name --template https://github.com/NativeScript/template-hello-world-ts.git#master 24 | ``` 25 | -------------------------------------------------------------------------------- /auth-helper-google.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | export class AuthHelperGoogle extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 8 | 9 | constructor(clientId: string, scope: Array) { 10 | super(); 11 | var scopeStr = scope.join('%20'); 12 | this.credentials = { 13 | authority: 'https://accounts.google.com/o', 14 | authorizeEndpoint: '/oauth2/v2/auth', 15 | tokenEndpoint: '/oauth2/v2.0/token', 16 | clientId: clientId, 17 | redirectUri: 'urn:ietf:wg:oauth:2.0:oob', 18 | scope: scopeStr 19 | }; 20 | } 21 | 22 | public logout(successPage?: string): Promise { 23 | let cookieDomains = [".google.com"]; //need to double check this 24 | return this._logout(successPage, cookieDomains); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /typings/querystring.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for query-string v3.0.0 2 | // Project: https://github.com/sindresorhus/query-string 3 | // Definitions by: Sam Verschueren 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | declare module "querystring" { 7 | /** 8 | * Parse a query string into an object. 9 | * Leading ? or # are ignored, so you can pass location.search or location.hash directly. 10 | * @param str 11 | */ 12 | export function parse(str: string): any; 13 | 14 | /** 15 | * Stringify an object into a query string, sorting the keys. 16 | * 17 | * @param obj 18 | */ 19 | export function stringify(obj: any, options?: {strict: boolean}): string; 20 | 21 | /** 22 | * Extract a query string from a URL that can be passed into .parse(). 23 | * 24 | * @param str 25 | */ 26 | export function extract(str: string): string; 27 | } -------------------------------------------------------------------------------- /auth-helper-office365.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | export class AuthHelperOffice365 extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 8 | 9 | constructor(clientId: string, scope: Array) { 10 | super(); 11 | var scopeStr = scope.join('%20'); 12 | this.credentials = { 13 | authority: 'https://login.microsoftonline.com/common', 14 | authorizeEndpoint: '/oauth2/v2.0/authorize', 15 | tokenEndpoint: '/oauth2/v2.0/token', 16 | clientId: clientId, 17 | redirectUri: 'urn:ietf:wg:oauth:2.0:oob', 18 | scope: scopeStr 19 | }; 20 | } 21 | 22 | public logout(successPage?: string): Promise { 23 | let cookieDomains = ["login.microsoftonline.com", ".live.com"]; 24 | return this._logout(successPage, cookieDomains); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /demo/app/main-view-model.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'data/observable'; 2 | import * as frameModule from "ui/frame"; 3 | import * as tnsOAuthModule from 'nativescript-oauth'; 4 | 5 | export class HelloWorldModel extends Observable { 6 | public message: string; 7 | 8 | constructor() { 9 | super(); 10 | } 11 | 12 | public onTapLogin() { 13 | tnsOAuthModule.ensureValidToken() 14 | .then((token: string) => { 15 | console.log('token: ' + token); 16 | }) 17 | .catch((er) => { 18 | console.error('error logging in'); 19 | console.dir(er); 20 | }); 21 | } 22 | 23 | public onTapLogout() { 24 | tnsOAuthModule.logout() 25 | .then(() => console.log('logged out')) 26 | .catch((er) => { 27 | console.error('error logging out'); 28 | console.dir(er); 29 | }); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /demo/typings/querystring.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for query-string v3.0.0 2 | // Project: https://github.com/sindresorhus/query-string 3 | // Definitions by: Sam Verschueren 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | declare module "querystring" { 7 | /** 8 | * Parse a query string into an object. 9 | * Leading ? or # are ignored, so you can pass location.search or location.hash directly. 10 | * @param str 11 | */ 12 | export function parse(str: string): any; 13 | 14 | /** 15 | * Stringify an object into a query string, sorting the keys. 16 | * 17 | * @param obj 18 | */ 19 | export function stringify(obj: any, options?: {strict: boolean}): string; 20 | 21 | /** 22 | * Extract a query string from a URL that can be passed into .parse(). 23 | * 24 | * @param str 25 | */ 26 | export function extract(str: string): string; 27 | } -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo-angular/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import * as tnsOAuthModule from 'nativescript-oauth'; 3 | import * as dialogs from 'ui/dialogs'; 4 | 5 | @Component({ 6 | selector: "my-app", 7 | templateUrl: "app.component.html", 8 | }) 9 | export class AppComponent { 10 | 11 | public onTapLogin() { 12 | tnsOAuthModule.ensureValidToken() 13 | .then((token: string) => { 14 | console.log('Token: ' + token); 15 | }) 16 | .catch((er) => { 17 | console.error('error logging in'); 18 | console.dir(er); 19 | }); 20 | } 21 | 22 | public onTapLogout() { 23 | tnsOAuthModule.logout() 24 | .then(() => console.log('logged out')) 25 | .catch((er) => { 26 | console.error('error logging out'); 27 | console.dir(er); 28 | }); 29 | } 30 | 31 | public authcallback() { 32 | console.log('yay callback'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /auth-helper-facebook.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | export class AuthHelperFacebook extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 8 | 9 | constructor(clientId: string, clientSecret: string, scope: Array) { 10 | super(); 11 | var scopeStr = scope.join('%20'); 12 | this.credentials = { 13 | authority: 'https://www.facebook.com/dialog', 14 | tokenEndpointBase: 'https://graph.facebook.com', 15 | authorizeEndpoint: '/oauth', 16 | tokenEndpoint: '/v2.3/oauth/access_token', 17 | clientId: clientId, 18 | clientSecret: clientSecret, 19 | redirectUri: 'https://www.facebook.com/connect/login_success.html', 20 | scope: scopeStr 21 | }; 22 | } 23 | 24 | public logout(successPage?: string): Promise { 25 | let cookieDomains = [".facebook.com"]; //need to double check this 26 | return this._logout(successPage, cookieDomains); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | nativescript-oauth 4 | Copyright (c) 2016, Alexander Ziskind 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as TnsOAuth from './tns-oauth-interfaces'; 3 | export * from './tns-oauth-interfaces'; 4 | 5 | export declare var instance: TnsOAuth.ITnsAuthHelper; 6 | export declare function initOffice365(options: TnsOAuth.ITnsOAuthOptionsOffice365): Promise; 7 | export declare function initFacebook(options: TnsOAuth.ITnsOAuthOptionsFacebook): Promise; 8 | export declare function initGoogle(options: TnsOAuth.ITnsOAuthOptionsGoogle): Promise; 9 | export declare function initUaa(options: TnsOAuth.ITnsOAuthOptionsUaa): Promise; 10 | export declare function initLinkedIn(options: TnsOAuth.ITnsOAuthOptionsLinkedIn): Promise; 11 | export declare function initSalesforce(options: TnsOAuth.ITnsOAuthOptionsSalesforce): Promise; 12 | export declare function initCustom(options: TnsOAuth.ITnsOAuthOptionsCustom): Promise; 13 | 14 | export declare function accessToken(): string; 15 | export declare function login(successPage?: string): Promise; 16 | export declare function logout(successPage?: string): Promise; 17 | export declare function accessTokenExpired(): boolean; 18 | export declare function ensureValidToken(): Promise; 19 | 20 | -------------------------------------------------------------------------------- /demo-angular/lib/iOS/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+UIImage_Async.h 3 | // TKImageAsync 4 | // 5 | // Created by Panayot Cankov on 4/18/16. 6 | // Copyright © 2016 Telerik A D. All rights reserved. 7 | // 8 | 9 | @interface UIImage (TNSBlocks) 10 | 11 | /** 12 | * Similar to imageNamed: however it runs on a separate queue so the UI thread is not blocked. 13 | * It also draws the UIImage in a small thumb to force decoding potentially avoiding UI hicckups when displayed. 14 | */ 15 | + (void) tns_safeDecodeImageNamed: (NSString*) name completion: (void (^) (UIImage*))callback; 16 | 17 | /** 18 | * Same as imageNamed, however calls to this method are sinchronized to be thread safe in iOS8 along with calls to tns_safeImageNamed and tns_safeDecodeImageNamed:completion: 19 | * imageNamed is thread safe in iOS 9 and later so in later versions this methods simply fallbacks to imageNamed: 20 | */ 21 | + (UIImage*) tns_safeImageNamed: (NSString*) name; 22 | 23 | + (void) tns_decodeImageWithData: (NSData*) data completion: (void (^) (UIImage*))callback; 24 | + (void) tns_decodeImageWidthContentsOfFile: (NSString*) file completion: (void (^) (UIImage*))callback; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /auth-helper-linkedin.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | /** 8 | Contains LinkedIn connection credentials 9 | */ 10 | export class AuthHelperLinkedIn extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 11 | //Constructs the the object with specified id, secret and scope 12 | constructor(clientId: string, clientSecret: string, redirectUri: string, scope: Array) { 13 | super(); 14 | var scopeStr = scope.join('%20'); 15 | this.credentials = { 16 | authority: 'https://www.linkedin.com', 17 | tokenEndpointBase: 'https://www.linkedin.com', 18 | authorizeEndpoint: '/oauth/v2/authorization', 19 | tokenEndpoint: '/oauth/v2/accessToken', 20 | clientId: clientId, 21 | clientSecret: clientSecret, 22 | redirectUri: redirectUri, 23 | scope: scopeStr 24 | }; 25 | } 26 | //Gets cookie domains for logging out 27 | public logout(successPage?: string): Promise { 28 | let cookieDomains = [".linkedin.com"]; 29 | return this._logout(successPage, cookieDomains); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /demo/app/app.ts: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, the app.ts file is the entry point to your application. 3 | You can use this file to perform app-level initialization, but the primary 4 | purpose of the file is to pass control to the app’s first module. 5 | */ 6 | 7 | import "./bundle-config"; 8 | import * as app from 'application'; 9 | import trace = require("trace"); 10 | import * as tnsOAuthModule from 'nativescript-oauth'; 11 | 12 | 13 | var o365InitOptions: tnsOAuthModule.ITnsOAuthOptionsOffice365 = { 14 | clientId: '31e1c318-a133-432f-a53b-5122ceab4c12', //client id for application (GUID) 15 | scope: ['Files.ReadWrite', 'User.ReadWrite', 'offline_access'] 16 | }; 17 | 18 | var facebookInitOptions: tnsOAuthModule.ITnsOAuthOptionsFacebook = { 19 | clientId: '1258457404242046', 20 | clientSecret: 'a24bae9b9e1e6104d9c684c01a96783d', 21 | scope: ['email'] 22 | }; 23 | 24 | //tnsOAuthModule.initOffice365(o365InitOptions); 25 | tnsOAuthModule.initFacebook(facebookInitOptions); 26 | 27 | trace.setCategories(trace.categories.All); 28 | trace.enable(); 29 | 30 | app.start({ moduleName: 'main-page' }); 31 | 32 | /* 33 | Do not place any code after the application has been started as it will not 34 | be executed on iOS. 35 | */ 36 | -------------------------------------------------------------------------------- /auth-helper-uaa.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as tnsOauth from './tns-oauth'; 4 | import { AuthHelper } from './auth-helper'; 5 | import * as TnsOAuth from './tns-oauth-interfaces'; 6 | 7 | export class AuthHelperUaa extends AuthHelper implements TnsOAuth.ITnsAuthHelper { 8 | 9 | private _cookieDomains: string[]; 10 | 11 | constructor(authority: string, redirectUri: string, clientId: string, clientSecret: string, scope: Array, cookieDomains: Array, basicAuthHeader: string) { 12 | super(); 13 | var scopeStr = scope.join('%20'); 14 | 15 | let uaaCreds: TnsOAuth.ITnsOAuthCredentialsUaa = { 16 | authority: authority, 17 | authorizeEndpoint: '/oauth/authorize', 18 | tokenEndpoint: '/oauth/token', 19 | clientId: clientId, 20 | clientSecret: clientSecret, 21 | redirectUri: redirectUri, 22 | scope: scopeStr, 23 | basicAuthHeader: basicAuthHeader 24 | }; 25 | 26 | this.credentials = uaaCreds; 27 | this._cookieDomains = cookieDomains; 28 | } 29 | 30 | public logout(successPage?: string): Promise { 31 | let cookieDomains = this._cookieDomains; 32 | return this._logout(successPage, cookieDomains); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /demo-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "NativeScript Application", 3 | "license": "SEE LICENSE IN ", 4 | "readme": "NativeScript Application", 5 | "repository": "", 6 | "nativescript": { 7 | "id": "org.nativescript.demoangular", 8 | "tns-ios": { 9 | "version": "3.4.1" 10 | }, 11 | "tns-android": { 12 | "version": "3.4.2" 13 | } 14 | }, 15 | "dependencies": { 16 | "@angular/animations": "~4.4.1", 17 | "@angular/common": "~4.4.1", 18 | "@angular/compiler": "~4.4.1", 19 | "@angular/core": "~4.4.1", 20 | "@angular/forms": "~4.4.1", 21 | "@angular/http": "~4.4.1", 22 | "@angular/platform-browser": "~4.4.1", 23 | "@angular/router": "~4.4.1", 24 | "nativescript-angular": "~4.4.0", 25 | "nativescript-oauth": "../", 26 | "nativescript-theme-core": "~1.0.2", 27 | "reflect-metadata": "~0.1.8", 28 | "rxjs": "~5.4.2", 29 | "tns-core-modules": "3.4.1", 30 | "zone.js": "~0.8.2" 31 | }, 32 | "devDependencies": { 33 | "babel-traverse": "6.26.0", 34 | "babel-types": "6.26.0", 35 | "babylon": "6.18.0", 36 | "lazy": "1.0.11", 37 | "nativescript-dev-typescript": "~0.5.0", 38 | "typescript": "2.3.4" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /demo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch on iOS", 6 | "type": "nativescript", 7 | "request": "launch", 8 | "platform": "ios", 9 | "appRoot": "${workspaceRoot}", 10 | "sourceMaps": true, 11 | "watch": true 12 | }, 13 | { 14 | "name": "Attach on iOS", 15 | "type": "nativescript", 16 | "request": "attach", 17 | "platform": "ios", 18 | "appRoot": "${workspaceRoot}", 19 | "sourceMaps": true, 20 | "watch": false 21 | }, 22 | { 23 | "name": "Launch on Android", 24 | "type": "nativescript", 25 | "request": "launch", 26 | "platform": "android", 27 | "appRoot": "${workspaceRoot}", 28 | "sourceMaps": true, 29 | "watch": true 30 | }, 31 | { 32 | "name": "Attach on Android", 33 | "type": "nativescript", 34 | "request": "attach", 35 | "platform": "android", 36 | "appRoot": "${workspaceRoot}", 37 | "sourceMaps": true, 38 | "watch": false 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /demo/app/main-page.ts: -------------------------------------------------------------------------------- 1 | /* 2 | In NativeScript, a file with the same name as an XML file is known as 3 | a code-behind file. The code-behind is a great place to place your view 4 | logic, and to set up your page’s data binding. 5 | */ 6 | 7 | import { EventData } from 'data/observable'; 8 | import { Page } from 'ui/page'; 9 | import { HelloWorldModel } from './main-view-model'; 10 | 11 | // Event handler for Page "navigatingTo" event attached in main-page.xml 12 | export function navigatingTo(args: EventData) { 13 | /* 14 | This gets a reference this page’s UI component. You can 15 | view the API reference of the Page to see what’s available at 16 | https://docs.nativescript.org/api-reference/classes/_ui_page_.page.html 17 | */ 18 | let page = args.object; 19 | 20 | /* 21 | A page’s bindingContext is an object that should be used to perform 22 | data binding between XML markup and TypeScript code. Properties 23 | on the bindingContext can be accessed using the {{ }} syntax in XML. 24 | In this example, the {{ message }} and {{ onTap }} bindings are resolved 25 | against the object returned by createViewModel(). 26 | 27 | You can learn more about data binding in NativeScript at 28 | https://docs.nativescript.org/core-concepts/data-binding. 29 | */ 30 | page.bindingContext = new HelloWorldModel(); 31 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "noImplicitAny": false, 6 | "removeComments": true, 7 | "experimentalDecorators": true, 8 | "noLib": false, 9 | "preserveConstEnums": true, 10 | "declaration": false, 11 | "noEmitHelpers": true, 12 | "suppressImplicitAnyIndexErrors": true, 13 | "lib": [ 14 | "es6", 15 | "dom" 16 | ], 17 | "baseUrl": ".", 18 | "paths": { 19 | "*": [ 20 | "./node_modules/tns-core-modules/*", 21 | "./node_modules/*" 22 | ] 23 | } 24 | }, 25 | "files": [ 26 | "auth-helper.ts", 27 | "auth-helper-facebook.ts", 28 | "auth-helper-google.ts", 29 | "auth-helper-office365.ts", 30 | "auth-helper-uaa.ts", 31 | "auth-helper-linkedin.ts", 32 | "index.ts", 33 | "tns-oauth.ts", 34 | "tns-oauth-page-provider.ts", 35 | "tns-oauth-token-cache.ts", 36 | "tns-oauth-utils.ts", 37 | "tns-oauth-webview-helper.ios.ts", 38 | "tns-oauth-webview-helper.android.ts", 39 | "./typings/querystring.d.ts", 40 | "./typings/url.d.ts" 41 | ], 42 | "compileOnSave": false, 43 | "exclude": [ 44 | "node_modules", 45 | "platforms" 46 | ] 47 | } -------------------------------------------------------------------------------- /tns-oauth-token-cache.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import * as TnsOAuth from './tns-oauth-interfaces'; 4 | 5 | import * as applicationSettingsModule from "application-settings"; 6 | 7 | const TNS_OAUTH_KEY = "TNS_OAUTH_KEY"; 8 | 9 | export class TnsOAuthTokenCache { 10 | 11 | public static hasToken(): boolean { 12 | return applicationSettingsModule.hasKey(TNS_OAUTH_KEY); 13 | } 14 | 15 | public static getToken(): TnsOAuth.ITnsOAuthTokenResult { 16 | if (applicationSettingsModule.hasKey(TNS_OAUTH_KEY)) { 17 | let trStr = applicationSettingsModule.getString(TNS_OAUTH_KEY); 18 | let tr = JSON.parse(trStr); 19 | 20 | if (tr.accessTokenExpiration) { 21 | tr.accessTokenExpiration = new Date(tr.accessTokenExpiration.toString()); 22 | } 23 | 24 | if (tr.refreshTokenExpiration) { 25 | tr.refreshTokenExpiration = new Date(tr.refreshTokenExpiration.toString()); 26 | } 27 | 28 | return tr; 29 | } 30 | else return null; 31 | } 32 | 33 | public static setToken(token: TnsOAuth.ITnsOAuthTokenResult) { 34 | applicationSettingsModule.setString(TNS_OAUTH_KEY, JSON.stringify(token)); 35 | } 36 | 37 | public static removeToken() { 38 | applicationSettingsModule.remove(TNS_OAUTH_KEY); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /tns-oauth-page-provider.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { Page } from 'ui/page'; 4 | import { GridLayout } from 'ui/layouts/grid-layout'; 5 | import { StackLayout } from 'ui/layouts/stack-layout'; 6 | import { isAndroid } from 'tns-core-modules/platform'; 7 | import { TnsOauthWebView } from './tns-oauth-webview'; 8 | //import { TnsOAuthWebViewDelegateImpl } from './tns-oauth-webview'; 9 | import { TnsOAuthWebViewHelper } from './tns-oauth-webview-helper'; 10 | 11 | 12 | export class TnsOAuthPageProvider { 13 | private _checkCodeIntercept: (WebView, error?, url?) => boolean; 14 | private _cancelEventHandler: (error?) => void; 15 | private _authUrl: string; 16 | 17 | constructor(checkCodeIntercept, authUrl, cancelEventHandler) { 18 | this._checkCodeIntercept = checkCodeIntercept; 19 | this._cancelEventHandler = cancelEventHandler; 20 | this._authUrl = authUrl; 21 | } 22 | 23 | public loginPageFunc() { 24 | let wv = new TnsOauthWebView(this._cancelEventHandler); 25 | 26 | TnsOAuthWebViewHelper.initWithWebViewAndIntercept(wv, this._checkCodeIntercept); 27 | 28 | let grid = new GridLayout(); 29 | grid.addChild(wv); 30 | 31 | let stack = new StackLayout(); 32 | stack.addChild(grid); 33 | 34 | let page = new Page(); 35 | page.content = stack; 36 | 37 | if (isAndroid) { 38 | page.actionBarHidden = true; 39 | } 40 | 41 | wv.src = this._authUrl; 42 | 43 | return page; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo-angular/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 27 | 28 | 29 |