Connect Xamarin.forms with MySQL - mysql

I know about xamarin connection with SQLite but it is locally
I need to connect my remotely MySQL database with xamarin.forms (I know about the security issue of this without using web services layer, but i will only use it for my own work)
This plugin is for xamarin.iOS and Xamarin.Android
I cannot add it using dependency service because i cannot add this component to the shared project
So is there any example of connecting MySQL database with xamarin.forms

You can't add references to your shared library. Shared libraries act like a list of files that are directly included in the project. The advantage of shared projects is just, that you do not have to maintain these included files for each project that uses code of the contained files. See the Xamarin documentation for further explanation.
What you have to do, if you want to consume a 3rd party libray within a shared library: Add the library to each project that uses the shared library (e.g. your iOS and Android project)
2ct to the mentioned security issue
You are right about the security issue. That's why I'd advice against, using mysql directly from your app. (I'll explain it for other readers that aren't aware of this problem and stumble over this question)
You should tunnel it through HTTPS because:
Some networks just block certain ports (HTTP and HTTPS are usually not blocked)
You publish your credentials with your app either statically or dynamically, but the credentials to your database are interceptable either way. You should authenticate a user and not an app. So there should be some kind of authentication / authorization that is revokeable. There was a nice talk from Kerry Lothrop on the Xamarin Evolve 2016 on this topic. https://www.youtube.com/watch?v=uLFtQHNxGaI

Related

Implementing OAuth for ODBC

I am trying to connect and query our foundry ontology from different Microsoft tools in our own network. I was able to do so using a token as described in the documentation. That works great and it is easy to configure. The problem is that it is associated to only one account and the token expires often.
Reading the documentation I saw the option for OAuth. What is not very clear in the documentation is whether we have to register an application for ODBC and how to do it. When I have had to register applications in the past in cloud environments, the application normally has a returned address that the cloud app hits to authenticate. However, in this case, I don't see how that would help for ODBC from desktop applications like Excel or Access.
Any suggestion or reading would be appreciated
To use the OAuth flow with the ODBC driver on Windows you can register a third-party application in Foundry (see docs). You can use a public or confidential client, and the redirect URL should be set to http://127.0.0.1/foundrydriver/oauthredirect.

Best way to download data from Sharepoint (I'm in need for some automation)

Basically there are some shared Excel files on my corporation's Sharepoint and I need local copies of It for data analysis. I am able to manually download all I need, but I need to automate this work somehow.
I'm writing this post because of issues regarding two aspects of this problem:
Microsoft Licenses: as I'm using a personal account on a corporation domain (for my work), so Microsoft won't let me setup gateways on Power Automate. I was able to create a Power Automate Flow that does exactly what I need, but my end point is messed up (can't connect to my local machine so I can create the file I need with the data from Sharepoint). I cannot acess these files with other account.
Two-factor authentication: I'm unable to use APIs with Sharepoint apparently because of this, and the authentication is something that I cannot disable due to my corporation's policies.
Any workaround is viable? I need some new ideas.
You could use PnP.PowerShell to automate this task.
For authentication issue just register an app on the target site collection and grant is access. Then use this app credentials to connect to the SharePoint site and download the files.
Reference -
To create a new app - https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/register-sharepoint-add-ins#to-register-by-using-appregnewaspx
Grant access to this app - https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs#setting-up-an-app-only-principal-with-tenant-permissions
Use this app to authenticate - https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-3

What is the difference between a Native Application & Server Application when talking about ADFS Application Groups?

I'm new to Federation Services and I'm trying to understand how ADFS works as a whole and I've started to get down into the details. I followed along with creating an app using OIDC to authenticate a user, however, within the tutorial, they specified using a "Server Application" when setting up an Application Group. This ended up not working for me so I tried setting up a "Native Application" application group for kicks and was able to successfully login.
The thing that threw me off is, I ended up hosting ADFS on a server outside of the domain in which I had my application running, so I'm confused as to how that is "native" in terms of ADFS.
I went looking for this answer within microsoft's documentation but I didn't find the information very clear.
Native Application:
"Sometimes called a public client, this is intended to be a client app that runs on a pc or device and with which the user interacts."
Server Application:
"A web application that runs on a server and is generally accessible to users via a browser. Because it is capable of maintaining its own client 'secret' or credential, it is sometimes called a confidential client."
This may seem simple to some, but I'm trying to really get a grip on what would be used when. To me it sounds like a native application is used when you're running the application natively on a pc in which the user is also using the same pc, and the server application is run remotely in which the user would not be using the same machine. Is it really that simple or am I misunderstanding?
A native application (in Microsoft speak) is something that is not browser based e.g. mobile. The code runs client side. It may use JavaScript in which case the secret key is publicly accessible. (The secret key is one of the OAuth parameters). You use ADAL / MSAL to access it.
A server application runs server side e.g a web API. The secret key is not publicly accessible. You use OWIN to access it.
These terms have no relevance to where ADFS is actually installed. Native applications typically are not domain joined.

How can I deploy an HTML5 web application in Google Cloud platform?

I am working on an HTML5 web application, which I need to host in Google cloud platform.
How can I deploy the web application, which is based on HTML5/CSS3, jQuery to Google Cloud platform/App Engine?
Clarification:
My web application is build using HTML5/CSS3 with javascript to process data. I am using Visual Studio IDE for development of the same. As per my understanding, apart from the supported languages like java, Python, etc, we can deploy html5 web application to Google cloud platform. How can I package my HTML5 application, which is not using any specific language and deploy to App Engine?
Thanks
Ambily
You can deploy to a bucket directly:
The Website Configuration feature enables you to configure a Google
Cloud Storage bucket to simulate the behavior of a static website. You
can define main pages or directory indices (for example, index.html)
for buckets and "directories". Also, you can define a custom error
page in case a requested resource does not exist.
No programming language at all required :)
Google Cloud Storage
You need a account with Google Cloud Platform to start with. Assuming you have that.
Go to cloud console where you find all the admin menus for creating instances.
You need to create a compute engine instance, if you want to create full fledged website.
Steps to follow:
Create a instance (linux, 10GB disk, 1.7GB memmory) and configure it for all required components.
After this you can move your files to your website folder usually "htdocs"
You will be assigned with an empirical IP address.
Using zone management tools you can add a new domain. All that using the admin panel, no complexity involved.
You may required to configure proxy, if you need access to other machines.

Integrating a Swing App With Tomcat

I recently created a web application with GWT. Then re-used most of the code to create a Swing version of the application that accesses a local database in offline mode. I am now implementing the 'online' mode of the application and want to access the same data as my GWT application.
Any ideas? Considered connecting directly to the MySQL server via SSL, but that's not working and doesn't seem as scalable. Should I use REST?
Any suggestions would be helpful.
To solve this problem in the past, we've used Jersey to create REST Web services which returns protocol buffers. The Swing app would then interact with the protocol buffers. The GWT app would ask for content type 'json' and receive protostuff objects in return. It worked quite well. That way, both apps can communicate with the server in the exact way.
Edit:
To allow your swing app to communicate with GWT-RPC, look at this blog article.