Identity Server 4/nativescript Hangs

just finsed the sample app

Step 01

We will open a Run window

On the keybord press

Windoes Key + R

wait

Step 02

We will open a cmd Window

On the Run window text-Input write

cmd

on the Keybord press

Enter

Step 03

We will make a directory and make it the working directory for our cmd

On the CMD Window write

mkdir D:\Experiments\E.IDser.NativeScript

cd /d D:\Experiments\E.IDser.NativeScript

Step 04

We will make a clone the sample project

On the CMD Window write

git clone https://github.com/Elrashid/nativescript-client-and-identity-server-sample.git

cd nativescript-client-and-identity-server-sample

Step 05

Now will run the apps

On the CMD Window write

Start.bat

Step 06

how to use

enter image description here enter image description here enter image description here

enter image description here enter image description here enter image description here

why

1    app
              +---+
                  |
     identity     |
2    server       |
                  |
                  |
                  |
3    google       +-+   user
                  |     intractiom
                  |
                  |       your
     identity     |       app
4    server       | <---+ stop
              +---+       here

5     app     +---+
                  |
                  |
                  |
     identity     +--+  background
6    server       |
                  |
                  |
7     app         |
               +--+

see register a custom URL scheme for Android

<data 
android:path="/home"
android:scheme="com.mysite.nativeapp
            .12365789785256-buv2dwer7
            jjjjv5fckasdftn367psbrlb"
/>

also you can try

 tns debug android

Erorr This site cannot be reached

communication between Identity Server and Native-Script

  • run

    nativescript-client-and-identity-server-sample/Start.bat
    
  • do not run run

    "nativescript-client-and-identity-server-sample/identity-server/Start.bat"
    "nativescript-client-and-identity-server-sample/nativescript-client/Start.bat"
    
  • native script app should run in in android emulator

    enter image description here

  • identity server should be run in local machine at port 5010

  • check in your windows browser you can open

    http://localhost:5010
    
  • if yes

  • check in your **android emulator ** browser you can open

    http://10.0.2.2:5010
    
  • what is 10.0.2.2 ?

    special alias to your android emulator host loopback interface

  • can i change where my host 10.0.2.2 ?

    open nativescript-client\app\my-oauth-provider.ts

        public authority = "http://10.0.2.2:5010";
        public tokenEndpointBase = "http://10.0.2.2:5010";
        public cookieDomains = ["10.0.2.2:5010"];
    
  • change http://10.0.2.2:5010 to your web address