web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create a login screen ...
Power Apps
Answered

Create a login screen within PowerApps to send a CustomAPI request with Basic Authentication

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I'm wondering whether it's possible to create an App whose first screen is a form containing Username and Password fields. Upon submitting these details, I would like to trigger a Flow that sends a CustomAPI request using the input details as credentials for Basic Authentication and then transport the response JSON data back to the PowerApp.

 

If anyone knows of a way to accomplish this I'd be very grateful. As of now, I'm not entirely sure it's possible. 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

     

     

    I am afraid currently this is not achieveable, specially for the Custom API part.

    The Authentication need to be configured when creating the Custom Connection, which means the connection should be created before the Custom API could be used in Microsoft Flow.

     

     

    In your scenario, the full scenario should be:

    1. Create PowerApps,

    2. Create Microsoft Flow with Custom API connection,

    3.Launch PowerApps, then enter username and password

    4. Pass the Basic-authenticate information through Microsoft Flow

    5. Authenticate the Custom API

    6. Get Response within MS Flow,

    7. Return the response back to PowerApps, 

     

    The issue I mentioned should happen at step 2 (also Step 4 and step 5).

    Flow would need the authentication information before adding the custom API connection under edit mode, once finished, there is no need to deal with the authentication information for the Custom API,

     

    Currently there is no proper way to configure the authentication used within Microsoft Flow:

    There is an idea submitted on the same topic, see:

    Change original owner of a flow

     

    You may also rise your own idea if this one does not meet your scenario.

     

    Regards,

    Michael

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Michael,

     

    Thanks for your reply. This is exactly what I ended up implementing over the course of yesterday.

     

    Everything functions as expected. However, I have another question that is quite specific to this case so I'd rather ask it on here than open up another message board.

     

    In my Flow, instead of using the CustomAPI, I just use the HTTP GET Action, and use the "Request-Response" action to retrieve the JSON object that I need to populate my gallery in PowerApps.

     

    What I'd like to know is if the user enters an incorrect username/password or the request is unable to go through, how do I handle these cases and send a prompt back to PowerApps? Any ideas would be appreciated!

     

    I'm attaching a picture of what my Flow looks like currently

    chrome_2018-07-25_09-40-51.png
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Apologize for the late response.

    For the user name and Password, please consider implement Data validation methods within PowerApps, and if the input didn't meet the requirements, remind the user with an Error message in a Label control, or through the Notify () function.

     

    Regards,

    Michael

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-micsh-msft

     

    That answer totally disregards my question. How can I perform data validation on a username and password when the only way to check if they are valid is to run my Flow and trigger the GET request using the user-input credentials?

     

    I know how to display Error messages. The problem is that when the authentication and thus the Flow fails, a default error message is displayed within PowerApps and I'd like to be able to catch/customize this message.

     

    Regards,

    Vidy

  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    I mean the User Name and Password validation within PowerApps Input, before sending them to Flow.

     

    Based on my knowledge, there is no method to customize the default error message for Flow failed.

     

    Regards,

    Michael

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Gotcha, I wanted to know more if the latter was possible, but I'll see if we can implement a system to check the credentials before triggering the Flow.

     

    Thanks for all the help.

     

    Cheers,

    Vidy

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard