Ionic 4 - Secure way to connect to Azure Storage

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.

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?

1 Like

@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/

Sorry, I have no experience whatsoever with Azure.

1 Like

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?

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.

2 Likes

Hi @ziguri,
Is there any MSAL for cordova android app?

Hi @ziguri: currently I’m tryinig to use the same library on iOS with capacitor. But I didn’t had any success.
Can you tell me if you did this with a pop up or redirect method? Any help would be appreciated :grinning: :v:

Greetings glaenzesch

Hello,
I’m trying to implement MSAL for my app ionic 5 (cordova not capacitor) , the auth is working fine with chrome but not working in ios and android …
Any ideas or help please …