cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Haarold
Frequent Visitor

Password Protected Screen

Hi, 

 

I have a screen that is password protected but didn't account for something in my solution. So how do I store the password in the power app so when a user enters the correct password once during that session, they can click in and out of that protected screen without it asking for the password each time? 

 

Thanks,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
GarethPrisk
Resident Rockstar
Resident Rockstar

I agree with @mdevaney - this should in no way be considered a secure way of doing something.

 

However, you're asking for a basic blocking pattern.

Add a variable to your app OnStart

Set(
    gblBlocker,
    true
)

Then add a TextInput control to allow them to enter the phrase, when required. This can toggle the variable off. Use the Boolean variable to show/hide, or enable/disable functionality.

For example, put this in the OnChange property of the TextInput.

If(
    Self.Text = "passPhrase" And gblBlocker,
    Set(
        gblBlocker,
        false
    )
)

 

Again, and I can't stress this enough - this is not secure/recommended for anything requires actual security, but I can appreciate that you may want to block functionality until a user does something.

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@Haarold 
Hello there!  Actually, there is no need to create a password protected screen in Power Apps.  All users must login to Power Apps with their valid Office 365 credentials making another login screen redundant.

 

What you should do instead is implement a 'role-based' user interface that changes based on who is using the app.  If the screen should only appear to Managers then we can show/hide the next screen button based on who they are.  To do this users would need to be stored in a table with their roles.

 

Here's an article I recently wrote on how to create a role-based user interface.

https://matthewdevaney.com/designing-a-role-based-user-interface-in-power-apps/

 

Example:

 

PowerApps-User-Roles-Demo (1).gif

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Haarold
Frequent Visitor

Hi, 

 

Thanks for this. I don't think this would work as I have 12k+ users accessing the app. Having a table would be a mammoth job to manage. 

 

Thanks,

 

@Haarold 

I would say that, likewise, having a single password for 12k+ users is not secure at all... you should consider a different strategy.

 

Perhaps you can come up another method based on the user’s Azure AD or Office 365 profile information.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

GarethPrisk
Resident Rockstar
Resident Rockstar

I agree with @mdevaney - this should in no way be considered a secure way of doing something.

 

However, you're asking for a basic blocking pattern.

Add a variable to your app OnStart

Set(
    gblBlocker,
    true
)

Then add a TextInput control to allow them to enter the phrase, when required. This can toggle the variable off. Use the Boolean variable to show/hide, or enable/disable functionality.

For example, put this in the OnChange property of the TextInput.

If(
    Self.Text = "passPhrase" And gblBlocker,
    Set(
        gblBlocker,
        false
    )
)

 

Again, and I can't stress this enough - this is not secure/recommended for anything requires actual security, but I can appreciate that you may want to block functionality until a user does something.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,761)