Ionic 4 - Secure way to connect to Azure Storage


#1

Hi,

I would like to data from a MS Azure Data Storage (e.g. Blob Storage) to my Ionic app.
Is there a secure way to do so?
How can i connect Ionic 4 to Azure Data Storage?

It is important for me that the user is not able to read the credentials (Storage Access Key) from the SourceCode. I was thinking about using something like DOTENV to store the credentials.
Any suggestions to solve that?

Thanks in advance.


#2

Sorry, it’s impossible. No matter what hoops you try to jump through, if the app needs access to a secret in order to do its job, and that secret isn’t dependent on something the user enters, then it must be in the app binary itself in a format that can be read by anybody with a copy of said app binary.

How about putting an application server in the middle and store the Azure credentials only there?


#3

@rapropos thx for your supply.

Ok i understand.
So, do you think that probably Azure Mobile Apps [see 1] as an application server would be a solution?

Is there any information around using Azure Mobile Apps in Combination with IONIC (perferable version 4)?

Primary i need to create a PWA (with the option of making an iOS/Android App out of it later on.)

Thx in advance.

[1] https://azure.microsoft.com/de-de/services/app-service/mobile/


#4

Sorry, I have no experience whatsoever with Azure.


#5

Ok no problem.

Do you think the IONIC Native MS Adal would help me to authenticate in Azure?

Is there a way to run MS Adal in a Browser?


#6

I just wanna give you a short update.
I found a solution.

What i did is i used the MSAL library of Microsoft.

Its written for Authentication in Azure AD with the v2 endpoint.
I used their angular wrapper.
Works like charme.
I am able now to login to Azure AD - now i am gonna write a small API to access the data from different storage options in Azure. I will keep you posted.