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

Notifications

Announcements

Community site session details

Community site session details

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

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

(0) ShareShare
ReportReport
Posted on by

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

  • v-micsh-msft Profile Picture
    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
    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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard