├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── demo-angular ├── .editorconfig ├── .gitignore ├── App_Resources │ ├── Android │ │ ├── app.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── drawable-ldpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── drawable-mdpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── drawable-nodpi │ │ │ └── splash_screen.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── background.png │ │ │ ├── icon.png │ │ │ └── logo.png │ │ │ ├── values-v21 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ └── iOS │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── icon-1024.png │ │ │ ├── icon-20.png │ │ │ ├── icon-20@2x.png │ │ │ ├── icon-20@3x.png │ │ │ ├── icon-29.png │ │ │ ├── icon-29@2x.png │ │ │ ├── icon-29@3x.png │ │ │ ├── icon-40.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-40@3x.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-60@3x.png │ │ │ ├── icon-76.png │ │ │ ├── icon-76@2x.png │ │ │ └── icon-83.5@2x.png │ │ ├── Contents.json │ │ ├── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-1125h.png │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-667h@2x.png │ │ │ ├── Default-736h@3x.png │ │ │ ├── Default-Landscape-X.png │ │ │ ├── Default-Landscape-XR.png │ │ │ ├── Default-Landscape-XS-Max.png │ │ │ ├── Default-Landscape.png │ │ │ ├── Default-Landscape@2x.png │ │ │ ├── Default-Landscape@3x.png │ │ │ ├── Default-Portrait-XR.png │ │ │ ├── Default-Portrait-XS-Max.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ ├── Default.png │ │ │ └── Default@2x.png │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen.AspectFill@3x.png │ │ └── LaunchScreen.Center.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchScreen-Center.png │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ └── LaunchScreen.Center@3x.png │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── build.xcconfig ├── LICENSE ├── angular.json ├── nativescript.config.ts ├── package-lock.json ├── package.json ├── references.d.ts ├── src │ ├── app.css │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── auth-providers-helper.ts │ │ ├── auth.service.ts │ │ ├── authenticated │ │ │ ├── authenticated.component.html │ │ │ └── authenticated.component.ts │ │ └── login │ │ │ ├── login.component.html │ │ │ └── login.component.ts │ └── main.ts ├── tsconfig.json ├── tsfmt.json └── webpack.config.js ├── demo-custom-provider ├── README.md ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── app.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-1024.png │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-1125h.png │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape-X.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ └── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ └── LaunchScreen-Center@2x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── auth-service.ts │ ├── main-page.ts │ ├── main-page.xml │ ├── main-view-model.ts │ ├── my-oauth-provider.ts │ └── package.json ├── package.json ├── tsconfig.json └── tsconfig.tns.json ├── demo-vue ├── .gitignore ├── .migration_backup │ ├── _backup.json │ ├── app │ │ └── package.json │ └── package.json ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── app.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-1024.png │ │ │ │ ├── icon-20.png │ │ │ │ ├── icon-20@2x.png │ │ │ │ ├── icon-20@3x.png │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-1125h.png │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape-X.png │ │ │ │ ├── Default-Landscape-XR.png │ │ │ │ ├── Default-Landscape-XS-Max.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait-XR.png │ │ │ │ ├── Default-Portrait-XS-Max.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ ├── LaunchScreen-AspectFill@2x.png │ │ │ │ └── LaunchScreen-AspectFill@3x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ ├── LaunchScreen-Center@2x.png │ │ │ │ └── LaunchScreen-Center@3x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── _app-common.scss │ ├── _app-variables.scss │ ├── app.js │ ├── app.scss │ ├── auth-service.js │ ├── components │ │ └── Home.vue │ └── fonts │ │ └── FontAwesome.ttf ├── jsconfig.json ├── nativescript.config.ts ├── package-lock.json ├── package.json └── tsconfig.json ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── app.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── res │ │ │ │ ├── drawable-hdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-ldpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-mdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-nodpi │ │ │ │ └── splash_screen.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── background.png │ │ │ │ ├── icon.png │ │ │ │ └── logo.png │ │ │ │ ├── values-v21 │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ └── iOS │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── icon-29.png │ │ │ │ ├── icon-29@2x.png │ │ │ │ ├── icon-29@3x.png │ │ │ │ ├── icon-40.png │ │ │ │ ├── icon-40@2x.png │ │ │ │ ├── icon-40@3x.png │ │ │ │ ├── icon-50.png │ │ │ │ ├── icon-50@2x.png │ │ │ │ ├── icon-57.png │ │ │ │ ├── icon-57@2x.png │ │ │ │ ├── icon-60@2x.png │ │ │ │ ├── icon-60@3x.png │ │ │ │ ├── icon-72.png │ │ │ │ ├── icon-72@2x.png │ │ │ │ ├── icon-76.png │ │ │ │ ├── icon-76@2x.png │ │ │ │ └── icon-83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.launchimage │ │ │ │ ├── Contents.json │ │ │ │ ├── Default-568h@2x.png │ │ │ │ ├── Default-667h@2x.png │ │ │ │ ├── Default-736h@3x.png │ │ │ │ ├── Default-Landscape.png │ │ │ │ ├── Default-Landscape@2x.png │ │ │ │ ├── Default-Landscape@3x.png │ │ │ │ ├── Default-Portrait.png │ │ │ │ ├── Default-Portrait@2x.png │ │ │ │ ├── Default.png │ │ │ │ └── Default@2x.png │ │ │ ├── LaunchScreen.AspectFill.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-AspectFill.png │ │ │ │ └── LaunchScreen-AspectFill@2x.png │ │ │ └── LaunchScreen.Center.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchScreen-Center.png │ │ │ │ └── LaunchScreen-Center@2x.png │ │ │ ├── Info.plist │ │ │ ├── LaunchScreen.storyboard │ │ │ └── build.xcconfig │ ├── app-root.xml │ ├── app.css │ ├── app.ts │ ├── auth-service.ts │ ├── main-page.ts │ ├── main-page.xml │ └── main-view-model.ts ├── nativescript.config.ts ├── package-lock.json ├── package.json ├── references.d.ts └── tsconfig.json ├── docs └── images │ └── nativescript-oauth2-logo.png ├── package-lock.json ├── publish ├── pack.sh ├── package-lock.json ├── package.json └── publish.sh ├── src ├── .npmignore ├── delegate │ ├── index.android.ts │ ├── index.d.ts │ └── index.ios.ts ├── index.d.ts ├── oauth.ts ├── package.json ├── pkce-util.android.ts ├── pkce-util.d.ts ├── pkce-util.ios.ts ├── platforms │ └── android │ │ └── include.gradle ├── providers │ ├── index.d.ts │ └── index.ts ├── references.d.ts ├── tns-oauth-auth-state.ts ├── tns-oauth-client-connection.ts ├── tns-oauth-login-sub-controller.ts ├── tns-oauth-login-webview-controller.ts ├── tns-oauth-native-view-controller.android.ts ├── tns-oauth-native-view-controller.d.ts ├── tns-oauth-native-view-controller.ios.ts ├── tns-oauth-utils.ts ├── tsconfig.json └── types │ └── android.d.ts └── tslint.json /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Make sure to check the demo app(s) for sample usage 2 | 3 | ### Make sure to check the existing issues in this repository 4 | 5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it 6 | Please, ensure your title is less than 63 characters long and starts with a capital 7 | letter. 8 | 9 | ### Which platform(s) does your issue occur on? 10 | - iOS/Android/Both 11 | - iOS/Android versions 12 | - emulator or device. What type of device? 13 | 14 | ### Please, provide the following version numbers that your issue occurs with: 15 | 16 | - CLI: (run `tns --version` to fetch it) 17 | - Cross-platform modules: (check the 'version' attribute in the 18 | `node_modules/tns-core-modules/package.json` file in your project) 19 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project) 20 | - Plugin(s): (look for the version numbers in the `package.json` file of your 21 | project and paste your dependencies and devDependencies here) 22 | 23 | ### Please, tell us how to recreate the issue in as much detail as possible. 24 | Describe the steps to reproduce it. 25 | 26 | ### Is there any code involved? 27 | - provide a code example to recreate the problem 28 | - (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible. 29 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | ## PR Checklist 11 | 12 | - [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages. 13 | - [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. 14 | - [ ] All existing tests are passing 15 | - [ ] Tests for the changes are included 16 | 17 | ## What is the current behavior? 18 | 19 | 20 | ## What is the new behavior? 21 | 22 | 23 | Fixes/Implements/Closes #[Issue Number]. 24 | 25 | 26 | 27 | 36 | 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | .DS_Store 4 | *.esm.json 5 | *.js 6 | *.js.map 7 | *.log 8 | src/*.d.ts 9 | !src/index.d.ts 10 | !src/pkce-util.d.ts 11 | !src/references.d.ts 12 | !src/tns-oauth-native-view-controller.d.ts 13 | !src/scripts/*.js 14 | !seed-tests/*.js 15 | seed-tests/seed-copy/**/*.* 16 | seed-tests/seed-copy-new-git-repo/**/*.* 17 | !demo/karma.conf.js 18 | !demo/app/tests/*.js 19 | demo/*.d.ts 20 | !demo/references.d.ts 21 | demo/lib 22 | demo/platforms 23 | node_modules 24 | publish/src 25 | publish/package 26 | demo/report/report.html 27 | demo/report/stats.json 28 | demo-angular/platforms 29 | demo-vue/platforms 30 | !demo-vue/**/*.js 31 | demo-vue/webpack.config.js 32 | demo-custom-provider/platforms 33 | 34 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | demo-angular/ 3 | demo-vue/ 4 | demo-custom-provider/ 5 | node_modules/ 6 | hooks/ 7 | *.log 8 | *.ts 9 | *.js.map 10 | tsconfig.json 11 | 12 | !index.d.ts 13 | !*.js 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | git: 2 | depth: 1 3 | 4 | branches: 5 | only: 6 | - master 7 | matrix: 8 | include: 9 | - stage: "Lint" 10 | language: node_js 11 | os: linux 12 | node_js: "8" 13 | script: cd src && npm run ci.tslint 14 | - stage: "Build" 15 | os: osx 16 | env: 17 | - Platform="iOS" 18 | - Type="VanillaJS" 19 | osx_image: xcode10.2 20 | language: node_js 21 | node_js: "10" 22 | jdk: oraclejdk8 23 | before_script: pod repo update 24 | script: 25 | - cd src && npm run build 26 | - cd ../demo && npm i && tns build ios --env.uglify 27 | - os: osx 28 | env: 29 | - Platform="iOS" 30 | - Type="VueJS" 31 | osx_image: xcode10.2 32 | language: node_js 33 | node_js: "10" 34 | jdk: oraclejdk8 35 | before_script: pod repo update 36 | script: 37 | - cd src && npm run build 38 | - cd ../demo-vue && npm i && tns build ios --env.uglify 39 | - os: osx 40 | env: 41 | - Platform="iOS" 42 | - Type="Angular" 43 | osx_image: xcode10.2 44 | language: node_js 45 | node_js: "10" 46 | jdk: oraclejdk8 47 | before_script: pod repo update 48 | script: 49 | - cd src && npm run build 50 | - cd ../demo-angular && npm i && tns build ios --env.uglify --env.aot 51 | - language: android 52 | os: linux 53 | dist: trusty 54 | env: 55 | - Platform="Android" 56 | - Type="VanillaJS" 57 | jdk: oraclejdk8 58 | before_install: nvm install 10 59 | script: 60 | - cd src && npm run build 61 | - cd ../demo && npm i && tns build android --env.uglify --env.snapshot 62 | - language: android 63 | os: linux 64 | dist: trusty 65 | env: 66 | - Platform="Android" 67 | - Type="VueJS" 68 | jdk: oraclejdk8 69 | before_install: nvm install 10 70 | script: 71 | - cd src && npm run build 72 | - cd ../demo-vue && npm i && tns build android --env.uglify --env.snapshot 73 | - language: android 74 | os: linux 75 | dist: trusty 76 | env: 77 | - Platform="Android" 78 | - Type="Angular" 79 | jdk: oraclejdk8 80 | before_install: nvm install 10 81 | script: 82 | - cd src && npm run build 83 | - cd ../demo-angular && npm i && tns build android --env.uglify --env.snapshot --env.aot 84 | 85 | android: 86 | components: 87 | - tools 88 | - platform-tools 89 | - build-tools-28.0.3 90 | - android-28 91 | - extra-android-m2repository 92 | 93 | before_cache: 94 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock 95 | 96 | cache: 97 | directories: 98 | - .nvm 99 | - $HOME/.gradle/caches/ 100 | - $HOME/.gradle/wrapper/ 101 | 102 | before_install: 103 | - sudo pip install --upgrade pip 104 | - sudo pip install six 105 | 106 | install: 107 | - echo no | npm install -g nativescript 108 | - tns usage-reporting disable 109 | - tns error-reporting disable 110 | 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | nativescript-oauth2 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. 22 | -------------------------------------------------------------------------------- /demo-angular/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | 9 | [*.json] 10 | indent_style = space 11 | indent_size = 2 12 | 13 | [*.ts] 14 | indent_style = space 15 | indent_size = 4 16 | -------------------------------------------------------------------------------- /demo-angular/.gitignore: -------------------------------------------------------------------------------- 1 | # NativeScript 2 | hooks/ 3 | node_modules/ 4 | platforms/ 5 | 6 | # NativeScript Template 7 | *.js.map 8 | *.js 9 | !webpack.config.js 10 | 11 | # Logs 12 | logs 13 | *.log 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # General 19 | .DS_Store 20 | .AppleDouble 21 | .LSOverride 22 | .idea 23 | .cloud 24 | .project 25 | tmp/ 26 | typings/ 27 | 28 | # Visual Studio Code 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | // If you want to add something to be applied before applying plugins' include.gradle files 9 | // e.g. project.ext.googlePlayServicesVersion = "15.0.1" 10 | // create a file named before-plugins.gradle in the current directory and place it there 11 | 12 | android { 13 | defaultConfig { 14 | generatedDensities = [] 15 | } 16 | aaptOptions { 17 | additionalParameters "--no-version-vectors" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "icon-20.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "icon-20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "icon-29.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "icon-29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "icon-40.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "icon-40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "icon-76.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "icon-76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "icon-83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "icon-1024.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo-angular/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 | "filename" : "LaunchScreen.AspectFill@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen.AspectFill@3x.png -------------------------------------------------------------------------------- /demo-angular/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 | "filename" : "LaunchScreen.Center@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-angular/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen.Center@3x.png -------------------------------------------------------------------------------- /demo-angular/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | CFBundleURLTypes 47 | 48 | 49 | CFBundleTypeRole 50 | Editor 51 | CFBundleURLName 52 | org.nativescript.testnsazmobaplugin 53 | CFBundleURLSchemes 54 | 55 | testnsazmobaplugin 56 | msalf376fa87-64a9-49a1-8b56-e0d48fc0810b 57 | fb691208554415645 58 | com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb 59 | org.nativescript.demoangular 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /demo-angular/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/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "cli": { 6 | "defaultCollection": "@nativescript/schematics" 7 | }, 8 | "projects": { 9 | "hello-world": { 10 | "root": "", 11 | "sourceRoot": "src", 12 | "projectType": "application", 13 | "prefix": "ns" 14 | } 15 | }, 16 | "defaultProject": "hello-world" 17 | } 18 | -------------------------------------------------------------------------------- /demo-angular/nativescript.config.ts: -------------------------------------------------------------------------------- 1 | import { NativeScriptConfig } from "@nativescript/core"; 2 | 3 | export default { 4 | id: "org.nativescript.demoangular", 5 | appResourcesPath: "App_Resources", 6 | android: { 7 | v8Flags: "--expose_gc", 8 | markingMode: "none", 9 | }, 10 | } as NativeScriptConfig; 11 | -------------------------------------------------------------------------------- /demo-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "NativeScript Application", 3 | "license": "SEE LICENSE IN ", 4 | "repository": "", 5 | "dependencies": { 6 | "@angular/animations": "~10.1.0", 7 | "@angular/common": "~10.1.0", 8 | "@angular/compiler": "~10.1.0", 9 | "@angular/core": "~10.1.0", 10 | "@angular/forms": "~10.1.0", 11 | "@angular/platform-browser": "~10.1.0", 12 | "@angular/platform-browser-dynamic": "~10.1.0", 13 | "@angular/router": "~10.1.0", 14 | "@nativescript/angular": "~10.1.0", 15 | "@nativescript/core": "~7.0.0", 16 | "@nativescript/theme": "~2.3.0", 17 | "reflect-metadata": "~0.1.12", 18 | "rxjs": "^6.6.0", 19 | "zone.js": "~0.11.1", 20 | "nativescript-oauth2": "file:../src" 21 | }, 22 | "devDependencies": { 23 | "@angular/compiler-cli": "~10.1.0", 24 | "@nativescript/ios": "7.0.0", 25 | "@nativescript/types": "~7.0.0", 26 | "@nativescript/webpack": "~3.0.0", 27 | "@ngtools/webpack": "~10.1.0", 28 | "typescript": "~3.9.0" 29 | }, 30 | "readme": "NativeScript Application", 31 | "main": "main.js" 32 | } 33 | -------------------------------------------------------------------------------- /demo-angular/references.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /demo-angular/src/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 | In many cases you may want to use the NativeScript core theme instead 9 | of writing your own CSS rules. You can learn more about the 10 | NativeScript core theme at https://github.com/nativescript/theme 11 | The imported CSS rules must precede all other types of rules. 12 | */ 13 | @import "~@nativescript/theme/css/core.css"; 14 | @import "~@nativescript/theme/css/default.css"; 15 | 16 | /* Place any CSS rules you want to apply on both iOS and Android here. 17 | This is where the vast majority of your CSS code goes. */ 18 | 19 | /* 20 | The following CSS rule changes the font size of all Buttons that have the 21 | "-primary" class modifier. 22 | */ 23 | Button.-primary { 24 | font-size: 18; 25 | } 26 | -------------------------------------------------------------------------------- /demo-angular/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { NativeScriptRouterModule } from "@nativescript/angular"; 3 | import { Routes } from "@angular/router"; 4 | import { AuthenticatedComponent } from "./authenticated/authenticated.component"; 5 | import { LoginComponent } from "./login/login.component"; 6 | 7 | const routes: Routes = [ 8 | { path: "", redirectTo: "/login", pathMatch: "full" }, 9 | { path: "login", component: LoginComponent }, 10 | { path: "authenticated", component: AuthenticatedComponent }, 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [NativeScriptRouterModule.forRoot(routes)], 15 | exports: [NativeScriptRouterModule], 16 | }) 17 | export class AppRoutingModule {} 18 | -------------------------------------------------------------------------------- /demo-angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /demo-angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { Page } from "@nativescript/core"; 3 | 4 | @Component({ 5 | selector: "ns-app", 6 | moduleId: module.id, 7 | templateUrl: "app.component.html", 8 | }) 9 | export class AppComponent {} 10 | -------------------------------------------------------------------------------- /demo-angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; 2 | import { NativeScriptModule } from "@nativescript/angular"; 3 | 4 | import { AppRoutingModule } from "./app-routing.module"; 5 | import { AppComponent } from "./app.component"; 6 | import { AuthService } from "./auth.service"; 7 | import { AuthenticatedComponent } from "./authenticated/authenticated.component"; 8 | import { LoginComponent } from "./login/login.component"; 9 | 10 | // Uncomment and add to NgModule imports if you need to use two-way binding 11 | // import { NativeScriptFormsModule } from "nativescript-angular/forms"; 12 | 13 | // Uncomment and add to NgModule imports if you need to use the HttpClient wrapper 14 | // import { NativeScriptHttpClientModule } from "nativescript-angular/http-client"; 15 | 16 | @NgModule({ 17 | bootstrap: [AppComponent], 18 | imports: [NativeScriptModule, AppRoutingModule], 19 | declarations: [AppComponent, AuthenticatedComponent, LoginComponent], 20 | providers: [AuthService], 21 | schemas: [NO_ERRORS_SCHEMA], 22 | }) 23 | /* 24 | Pass your application module to the bootstrapModule function located in main.ts to start your app 25 | */ 26 | export class AppModule {} 27 | -------------------------------------------------------------------------------- /demo-angular/src/app/auth-providers-helper.ts: -------------------------------------------------------------------------------- 1 | import { 2 | TnsOAuthClient, 3 | configureTnsOAuth, 4 | ITnsOAuthTokenResult 5 | } from "nativescript-oauth2"; 6 | import { 7 | TnsOaProvider, 8 | TnsOaProviderOptionsFacebook, 9 | TnsOaProviderFacebook, 10 | TnsOaProviderOptionsGoogle, 11 | TnsOaProviderGoogle, 12 | TnsOaProviderOptionsMicrosoft, 13 | TnsOaProviderMicrosoft, 14 | TnsOaProviderOptionsIdentityServer, 15 | TnsOaProviderIdentityServer 16 | } from "nativescript-oauth2/providers"; 17 | 18 | export function configureOAuthProviders() { 19 | const microsoftProvider = configureOAuthProviderMicrosoft(); 20 | const googleProvider = configureOAuthProviderGoogle(); 21 | const facebookProvider = configureOAuthProviderFacebook(); 22 | const identityServer = configureOAuthProviderIdentityServer(); 23 | 24 | configureTnsOAuth([microsoftProvider, googleProvider, facebookProvider, identityServer]); 25 | } 26 | 27 | export function configureOAuthProviderGoogle(): TnsOaProvider { 28 | const googleProviderOptions: TnsOaProviderOptionsGoogle = { 29 | openIdSupport: "oid-full", 30 | clientId: 31 | "932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb.apps.googleusercontent.com", 32 | redirectUri: 33 | "com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb:/auth", 34 | urlScheme: 35 | "com.googleusercontent.apps.932931520457-buv2dnhgo7jjjjv5fckqltn367psbrlb", 36 | scopes: ["email"] 37 | }; 38 | const googleProvider = new TnsOaProviderGoogle(googleProviderOptions); 39 | return googleProvider; 40 | } 41 | 42 | export function configureOAuthProviderFacebook(): TnsOaProvider { 43 | const facebookProviderOptions: TnsOaProviderOptionsFacebook = { 44 | openIdSupport: "oid-none", 45 | clientId: "691208554415645", 46 | clientSecret: "d8725ac416fa1bb1917ccffd1670e3c6", 47 | redirectUri: "https://www.facebook.com/connect/login_success.html", 48 | scopes: ["email"] 49 | }; 50 | const facebookProvider = new TnsOaProviderFacebook(facebookProviderOptions); 51 | return facebookProvider; 52 | } 53 | 54 | export function configureOAuthProviderMicrosoft(): TnsOaProvider { 55 | const microsoftProviderOptions: TnsOaProviderOptionsMicrosoft = { 56 | openIdSupport: "oid-full", 57 | clientId: "f376fa87-64a9-49a1-8b56-e0d48fc0810b", 58 | // redirectUri: "urn:ietf:wg:oauth:2.0:oob", 59 | redirectUri: "msalf376fa87-64a9-49a1-8b56-e0d48fc0810b://auth", 60 | urlScheme: "msalf376fa87-64a9-49a1-8b56-e0d48fc0810b", 61 | scopes: ["openid", "https://outlook.office.com/mail.read"] 62 | }; 63 | const microsoftProvider = new TnsOaProviderMicrosoft( 64 | microsoftProviderOptions 65 | ); 66 | return microsoftProvider; 67 | } 68 | 69 | export function configureOAuthProviderIdentityServer(): TnsOaProvider { 70 | const identityServerProviderOptions: TnsOaProviderOptionsIdentityServer = { 71 | openIdSupport: 'oid-full', 72 | issuerUrl: 'https://demo.identityserver.io', 73 | clientId: 'native.code', 74 | urlScheme: 'org.nativescript.demoangular', 75 | redirectUri: 'org.nativescript.demoangular://auth', 76 | scopes: ['openid', 'profile', 'email', 'offline_access'], 77 | }; 78 | const identityServerProvider = new TnsOaProviderIdentityServer( 79 | identityServerProviderOptions 80 | ); 81 | return identityServerProvider; 82 | } 83 | -------------------------------------------------------------------------------- /demo-angular/src/app/auth.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from "@angular/core"; 2 | 3 | import { 4 | TnsOAuthClient, 5 | ITnsOAuthTokenResult 6 | } from "nativescript-oauth2"; 7 | 8 | @Injectable() 9 | export class AuthService { 10 | private client: TnsOAuthClient = null; 11 | 12 | constructor() { } 13 | 14 | public tnsOauthLogin(providerType): Promise { 15 | this.client = new TnsOAuthClient(providerType); 16 | 17 | return new Promise((resolve, reject) => { 18 | this.client.loginWithCompletion( 19 | (tokenResult: ITnsOAuthTokenResult, error) => { 20 | if (error) { 21 | console.error("back to main page with error: "); 22 | console.error(error); 23 | reject(error); 24 | } else { 25 | console.log("back to main page with access token: "); 26 | console.log(tokenResult); 27 | resolve(tokenResult); 28 | } 29 | } 30 | ); 31 | }); 32 | } 33 | 34 | public tnsOauthLogout(): Promise { 35 | return new Promise((resolve, reject) => { 36 | if (this.client) { 37 | this.client.logoutWithCompletion( 38 | (error) => { 39 | if (error) { 40 | console.error("back to main page with error: "); 41 | console.error(error); 42 | reject(error); 43 | } else { 44 | console.log("back to main page with success"); 45 | resolve(); 46 | } 47 | } 48 | ); 49 | } 50 | else { 51 | console.log("back to main page with success"); 52 | resolve(); 53 | } 54 | }); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /demo-angular/src/app/authenticated/authenticated.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /demo-angular/src/app/authenticated/authenticated.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { RouterExtensions } from "@nativescript/angular"; 3 | import { Page } from "@nativescript/core"; 4 | import { AuthService } from "../auth.service"; 5 | 6 | @Component({ 7 | selector: "ns-authenticated", 8 | moduleId: module.id, 9 | templateUrl: "authenticated.component.html", 10 | }) 11 | export class AuthenticatedComponent { 12 | constructor( 13 | private authService: AuthService, 14 | private routerExtensions: RouterExtensions 15 | ) {} 16 | 17 | public onTapLogout() { 18 | this.authService 19 | .tnsOauthLogout() 20 | .then(() => { 21 | this.routerExtensions.back(); 22 | }) 23 | .catch((e) => console.log("Error: " + e)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /demo-angular/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo-angular/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { RouterExtensions } from "@nativescript/angular"; 3 | import { ITnsOAuthTokenResult } from "nativescript-oauth2"; 4 | import { Page } from "@nativescript/core"; 5 | import { AuthService } from "../auth.service"; 6 | 7 | @Component({ 8 | selector: "ns-login", 9 | moduleId: module.id, 10 | templateUrl: "login.component.html", 11 | }) 12 | export class LoginComponent { 13 | constructor( 14 | private authService: AuthService, 15 | private routerExtensions: RouterExtensions 16 | ) {} 17 | 18 | public onTapLogin() { 19 | this.authService 20 | .tnsOauthLogin("microsoft") 21 | .then((result: ITnsOAuthTokenResult) => { 22 | console.log( 23 | "back to login component with token " + result.accessToken 24 | ); 25 | this.routerExtensions 26 | .navigate(["../authenticated"]) 27 | .then(() => console.log("navigated to /authenticated")) 28 | .catch((err) => 29 | console.log( 30 | "error navigating to /authenticated: " + err 31 | ) 32 | ); 33 | }) 34 | .catch((e) => console.log("Error: " + e)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /demo-angular/src/main.ts: -------------------------------------------------------------------------------- 1 | // this import should be first in order to load some required settings (like globals and reflect-metadata) 2 | import { platformNativeScriptDynamic } from "@nativescript/angular"; 3 | 4 | import { AppModule } from "./app/app.module"; 5 | import { configureOAuthProviders } from "./app/auth-providers-helper"; 6 | 7 | // A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page. 8 | // Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers. 9 | // A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic, 10 | // that sets up a NativeScript application and can bootstrap the Angular framework. 11 | 12 | configureOAuthProviders(); 13 | 14 | platformNativeScriptDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /demo-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ESNext", 4 | "target": "es2015", 5 | "moduleResolution": "node", 6 | "experimentalDecorators": true, 7 | "emitDecoratorMetadata": true, 8 | "noEmitHelpers": true, 9 | "noEmitOnError": true, 10 | "skipLibCheck": true, 11 | "lib": ["es2018", "es2017", "dom", "es6"], 12 | "baseUrl": ".", 13 | "paths": { 14 | "~/*": ["app/*"] 15 | } 16 | }, 17 | "include": ["src/tests/**/*.ts", "src/**/*.ios.ts", "src/**/*.android.ts"], 18 | "files": ["./references.d.ts", "./src/main.ts", "../src/oauth.ts"], 19 | "exclude": ["node_modules", "platforms", "e2e"] 20 | } 21 | -------------------------------------------------------------------------------- /demo-angular/tsfmt.json: -------------------------------------------------------------------------------- 1 | { 2 | "indentSize": 2, 3 | "tabSize": 2 4 | } 5 | -------------------------------------------------------------------------------- /demo-custom-provider/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 | # Issues 26 | 27 | Issues related to `template-hello-world-ts` template should be logged in the https://github.com/NativeScript/NativeScript repository. 28 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // implementation 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | } 12 | aaptOptions { 13 | additionalParameters "--no-version-vectors" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/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-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/values-v21/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3d5afe 4 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 14 | 15 | 16 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F5F5F5 4 | #757575 5 | #33B5E5 6 | #272734 7 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/Android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 21 | 22 | 23 | 31 | 32 | 34 | 35 | 36 | 42 | 43 | 45 | 46 | -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon-29.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon-29@2x.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "icon-29@3x.png", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon-40@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "icon-40@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "icon-60@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "icon-60@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "icon-29.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "29x29", 53 | "idiom" : "ipad", 54 | "filename" : "icon-29@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "icon-40.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "40x40", 65 | "idiom" : "ipad", 66 | "filename" : "icon-40@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "icon-76.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "76x76", 77 | "idiom" : "ipad", 78 | "filename" : "icon-76@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "83.5x83.5", 83 | "idiom" : "ipad", 84 | "filename" : "icon-83.5@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "1024x1024", 89 | "idiom" : "ios-marketing", 90 | "filename" : "icon-1024.png", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/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-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/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-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexziskind1/nativescript-oauth2/ad28fb447213f6bbf60c099607b2326d4e64247e/demo-custom-provider/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png -------------------------------------------------------------------------------- /demo-custom-provider/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiresFullScreen 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo-custom-provider/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-custom-provider/app/app-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /demo-custom-provider/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 | In many cases you may want to use the NativeScript core theme instead 9 | of writing your own CSS rules. For a full list of class names in the theme 10 | refer to http://docs.nativescript.org/ui/theme. 11 | The imported CSS rules must precede all other types of rules. 12 | */ 13 | @import '~nativescript-theme-core/css/core.light.css'; 14 | 15 | /* 16 | The following CSS rule changes the font size of all UI 17 | components that have the btn class name. 18 | */ 19 | .btn { 20 | font-size: 18; 21 | } 22 | -------------------------------------------------------------------------------- /demo-custom-provider/app/app.ts: -------------------------------------------------------------------------------- 1 | import * as application from "tns-core-modules/application"; 2 | import { configureOAuthProviders } from "./auth-service"; 3 | 4 | configureOAuthProviders(); 5 | 6 | application.run({ moduleName: "app-root" }); 7 | -------------------------------------------------------------------------------- /demo-custom-provider/app/auth-service.ts: -------------------------------------------------------------------------------- 1 | import { 2 | TnsOAuthClient, 3 | configureTnsOAuth, 4 | ITnsOAuthTokenResult 5 | } from "nativescript-oauth2"; 6 | import { 7 | TnsOaProvider 8 | } from "nativescript-oauth2/providers"; 9 | import { TnsOaProviderMyCustomProvider, TnsOaMyCustomProviderOptions } from "./my-oauth-provider"; 10 | 11 | let client: TnsOAuthClient = null; 12 | 13 | export function configureOAuthProviders() { 14 | const myCustomProvider = configureOAuthProviderMyCustomProvider(); 15 | configureTnsOAuth([myCustomProvider]); 16 | } 17 | 18 | function configureOAuthProviderMyCustomProvider(): TnsOaProvider { 19 | const facebookProviderOptions: TnsOaMyCustomProviderOptions = { 20 | openIdSupport: "oid-none", 21 | clientId: "691208554415645", 22 | clientSecret: "d8725ac416fa1bb1917ccffd1670e3c6", 23 | redirectUri: "https://www.facebook.com/connect/login_success.html", 24 | scopes: ["email"] 25 | }; 26 | const facebookProvider = new TnsOaProviderMyCustomProvider(facebookProviderOptions); 27 | return facebookProvider; 28 | } 29 | 30 | export function tnsOauthLogin(providerType) { 31 | client = new TnsOAuthClient(providerType); 32 | 33 | client.loginWithCompletion((tokenResult: ITnsOAuthTokenResult, error) => { 34 | if (error) { 35 | console.error("back to main page with error: "); 36 | console.error(error); 37 | } else { 38 | console.log("back to main page with access token: "); 39 | console.log(tokenResult); 40 | } 41 | }); 42 | } 43 | 44 | export function tnsOauthLogout() { 45 | if (client) { 46 | client.logout(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo-custom-provider/app/main-page.ts: -------------------------------------------------------------------------------- 1 | import { EventData } from "tns-core-modules/data/observable"; 2 | import { Page } from "tns-core-modules/ui/page"; 3 | import { HelloWorldModel } from "./main-view-model"; 4 | import { tnsOauthLogin, tnsOauthLogout } from "./auth-service"; 5 | 6 | let page: Page; 7 | 8 | export function navigatingTo(args: EventData) { 9 | page = args.object; 10 | page.bindingContext = new HelloWorldModel(); 11 | } 12 | 13 | export function onLoginTap() { 14 | tnsOauthLogin("myCustomProvider"); 15 | } 16 | 17 | export function onLogoutTap() { 18 | tnsOauthLogout(); 19 | } 20 | -------------------------------------------------------------------------------- /demo-custom-provider/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |