Hello, i have a task to create web site with MSSQL database and ASP.NET C# MVC but this site MUST be accessable only from users with my B4A app and not accessable from web browsers and other phones with different IMEI...
I can use HttpJob like this code to receive data or entire web page and send username password and Phone IMEI
B4X:
Public appUrl1 As String = appServer & "/page1/__USERNAME__/__PASSWORD__/_PHONEIMEI__"
Dim job3 As HttpJob
job3.Initialize("JobLogin", Me)
job3.Download(appUrl1)
OR
B4X:
Dim Web as WebView
Web.LoadURL(appUrl1 )
But my biggest concern is: IF USER WRITE THIS URL DIRECTLY TO BROWSER IT WILL ACCESS SITE.
User MUST load site ONLY from WebView into my B4A app
How to protect site? Any answer will be useful for me!
there is a single tcp packet knock knock utility on entware(ng)...you send a packet from the app and only then is the perfectly normal web server port available for a perfectly standard http request...just saying...since a browser cannot send that tcp packet, only your android app users will be able to access that website...say for html apps or the like..
Hello guys, i am having problems with a url with ssl certificate, i try with Ctrl + B, HU2_ACCEPTALL and only get a white screen. Thank you in advance! Regards
www.b4x.com
So, there was an SSL problem, and you are using Webviewextras2 to ignore the SSL error.
I wanted to post this solution so other forum members can learn.
Hello guys, i am having problems with a url with ssl certificate, i try with Ctrl + B, HU2_ACCEPTALL and only get a white screen. Thank you in advance! Regards
www.b4x.com
So, there was an SSL problem, and you are using Webviewextras2 to ignore the SSL error.
I wanted to post this solution so other forum members can learn.
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private WebView1 As WebView
Private we As WebViewExtras
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
we.Initialize(WebView1)
Dim client As DefaultWebViewClient
client.Initialize("client")
we.SetWebViewClient(client)
WebView1.LoadUrl("https://192.168.0.200/")
End Sub
Sub client_ReceivedSslError(SslErrorHandler1 As SslErrorHandler, SslError1 As SslError)
Log(SslError1)
SslErrorHandler1.Proceed
End Sub
The Sub client_ReceivedSslError is very important! Without this sub nothings work!