// can we have a website runnng on android server, // and have user authenticated with MID? // make sure to target 4.6 to enable async tasks // namesapce sk // first order of business. add https://tsp.demo.sk.ee/?wsdl public Application(IApp page) { Native.window.onerror += e => { new IHTMLPre { new { e.error, e.message } }.AttachToDocument(); }; // this will go full screen //var sheet1 = new UserControl1 { }.AttachControlToDocument(); // wont load on S1, why? //- waiting for device - //error: protocol fault (status read) //- waiting for device - //error: more than one device and emulator //C:\Users\Arvo>x:\util\android-sdk-windows\platform-tools\adb.exe devices //List of devices attached //3330A17632C000EC device var o = new IHTMLOutput { }.AttachToDocument(); o.style.position = IStyle.PositionEnum.relative; o.style.display = IStyle.DisplayEnum.block; //width: 600px; height: 300px; display: block; position: relative; background: red; o.style.SetSize(800, 200); //var sheet1 = new UserControl1 { }.AttachControlTo(Native.document.body); var sheet1 = new UserControl1 { }.AttachControlTo(o); new { }.With( async delegate { var enter = new IHTMLButton { "authenticate with MobileID as +37200007" }.AttachToDocument(); //sheet1.identitySheet1BindingSourceBindingSource.PositionChanged += sheet1.identitySheet1BindingSourceBindingSource.CurrentChanged += delegate { //var xDataRowView = sheet1.identitySheet1BindingSourceBindingSource.Current as DataRowView; Data.identitySheet1Row row = sheet1.identitySheet1BindingSourceBindingSource.Current as DataRowView; enter.innerText = "authenticate with MobileID as " + new { row.Tel_nr, row.Isikukood, //sheet1.identitySheet1BindingSourceBindingSource.Current //row }; }; retry: enter.disabled = false; await enter.async.onclick; { Data.identitySheet1Row row = sheet1.identitySheet1BindingSourceBindingSource.Current as DataRowView; enter.disabled = true; // done { Sesscode = 1832228359, Status = OK, UserIDCode = 14212128025, UserCN = TESTNUMBER,SEITSMES,14212128025, ChallengeID = 0101, Challenge = 03010400000000000000F4EC792BF7FEB1263A65 } var sw = Stopwatch.StartNew(); new IHTMLPre { () => new { sw.ElapsedMilliseconds, row.Tel_nr, row.Isikukood } }.AttachToDocument(); var x = await MobileID(PhoneNo: row.Tel_nr, IDCode: row.Isikukood); new IHTMLPre { "done " + new{ // loodud sessiooni identifikaator x.Sesscode, // kasutaja autentimiseks tuleb //teha täiendavad staatusepäringud kuni //autentimistoimingu olek on “USER_AUTHENTICATED” x.Status, // Autenditava isiku isikukood. Väärtus võetakse //isikutuvastuse sertifikaadi eraldusnime “Serial Number” //väljalt. x.UserIDCode, // Autenditava isiku isikutuvastuse sertifikaadi põhinimi. //Väärtus võetakse isikutuvastuse sertifikaadi eraldusnime //CN (Common Name) väljalt. x.UserCN, // 4 tähemärgiline kontrollkood, mis arvutatakse kasutaja // telefonile signeerimiseks saadetava Challenge väärtuse //põhjal.Antud kontrollkood tuleb mobiilautentimist //võimaldaval rakendusel kuvada kasutajale ja selle kaudu //on võimalik kasutajal veenduda päringu autentsuses. x.ChallengeID, //Kasutaja poolt autentimisel allkirjastatav sõnum, //koosneb rakenduse looja poolt saadetud sõnumist //(SPChallange, 10 baiti) ja teenuse poolt lisatust (samuti //10 baiti). Tagastatakse vaid juhul, kui päringus //SPChallenge väli on väärtustatud. x.Challenge } }.AttachToDocument(); sw.Stop(); } goto retry; } ); }