Skip to content

Commit

Permalink
Moved app-login sample to powerplatform-samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Laskewitz committed May 8, 2024
1 parent 5c4fb88 commit 1ba4819
Show file tree
Hide file tree
Showing 37 changed files with 19,033 additions and 0 deletions.
109 changes: 109 additions & 0 deletions samples/app-login/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# App Login

## Summary

This sample allows a user to enter their credentials, a username and password, in order to authenticate themselves and gain access to a homepage. It shows the basic authentication flow. There is also an error page that opens when a wrong password is entered.

Default Credentials:

Username|Password
-------|----
admin|admin
seth|1234

>Preview
![picture of the sample](assets/preview.gif)

## Applies to

* [Microsoft Power Apps](https://docs.microsoft.com/powerapps/)
* [Sharepoint](https://learn.microsoft.com/sharepoint/)

## Compatibility

![Power Apps Source File Pack and Unpack Utility 0.20](https://img.shields.io/badge/Packing%20Tool-0.20-green.svg)
![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-green.svg "Premium Power Apps license not required")
![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-green.svg "Does not rely on experimental features")
![On-Premises Connectors](https://img.shields.io/badge/On--Premises%20Connectors-No-green.svg "Does not use on-premise connectors")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-Not%20Required-green.svg "Does not use custom connectors")

## Authors

Solution|Author(s)
--------|---------
app-login | [Seth Addo](https://github.com/seths10), University Of Cape Coast

## Version history

Version|Date|Comments
-------|----|--------
1.0|January 4, 2023|Initial release

## Features

This sample illustrates the following concepts:

* Authentication

## Prerequisites

None

## Data Sources

Data is obtained from SharePoint

### SharePoint List

This SharePoint list has two columns: Title for `Username` and the Password column. Set the list up as follows:

|Type|Internal Name|Required|
|---|---|:---:|
|Single line of text|Title|Yes|
|Single line of text|Password|Yes|

## Minimal Path to Awesome

* [Download](./solution/app-login-sample.msapp) the `.msapp` from the `solution` folder
* Within **Power Apps Studio**, use the `.msapp` file using **File** > **Open** > **Browse** and select the `.msapp` file you just downloaded.
* Create a Sharepoint list as shown above and add some data to it.
* Select the **Data** tab.
* Select Add data.
* Search for Sharepoint
* Select your list

## Using the Source Code

You can also use the [Power Apps CLI](https://docs.microsoft.com/powerapps/developer/data-platform/powerapps-cli) to pack the source code by following these steps::

* Clone the repository to a local drive
* Pack the source files back into `.msapp` file:

```bash
pac canvas pack --sources pathtosourcefolder --msapp pathtomsapp
```

Making sure to replace `pathtosourcefolder` to point to the path to this sample's `sourcecode` folder, and `pathtomsapp` to point to the path of this solution's `.msapp` file (located under the `solution` folder)
* Within **Power Apps Studio**, use the `.msapp` file using **File** > **Open** > **Browse** and select the `.msapp` file you just packed.

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

## Help

We do not support samples, but we this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=YOURSAMPLENAME&authors=@YOURGITHUBUSERNAME&title=YOURSAMPLENAME%20-%20).

## For more information

* [Overview of creating apps in Power Apps](https://docs.microsoft.com/powerapps/maker/)
* [Power Apps canvas apps documentation](https://docs.microsoft.com/powerapps/maker/canvas-apps/)

<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-samples/samples/app-login" />
Binary file added samples/app-login/assets/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/app-login/assets/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/app-login/assets/preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions samples/app-login/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/pnp/samples/v1.0/metadata-schema.json",
"name": "pnp-powerplatform-samples-app-login",
"version": "1.0.0.0",
"source": "pnp",
"creationDateTime": "2023-02-02T00:00:00.000Z",
"updateDateTime": "2023-02-02T00:00:00.000Z",
"title": "App Login",
"shortDescription": "This sample allows a user to enter their credentials, a username and password, in order to authenticate themselves and gain access to a homepage.",
"longDescription": [
"This sample allows a user to enter their credentials, a username and password, in order to authenticate themselves and gain access to a homepage. It shows the basic authentication flow. There is also an error page that opens when a wrong password is entered."
],
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/app-login",
"products": [
"Power Apps",
"Power Platform"
],
"tags": [
"ACCESSIBILITY", "CANVAS"
],
"categories": [
"POWERAPPS"
],
"metadata": [
{
"key": "POWERAPPS-MANIFEST-VERSION",
"value": "0.20"
},
{
"key": "POWERAPPS-TYPE",
"value": "Canvas"
},
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "No"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/powerplatform-samples/main/samples/app-login/assets/home.png",
"alt": "Preview"
}
],
"authors": [
{
"gitHubAccount": "seths10",
"name": "Seth Addo",
"pictureUrl": "https://github.com/seths10.png"
}
],
"references": [
{
"name": "Overview of creating apps in Power Apps",
"description": "Power Apps is a high-productivity development platform for business apps.",
"url": "https://docs.microsoft.com/powerapps/maker/"
},
{
"name": "Power Apps canvas apps documentation",
"description": "Design and build a business app from a canvas in Microsoft Power Apps with data from a variety of sources without writing any code using traditional programming languages, such as C#.",
"url": "https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/"
}
]
}
]
Binary file added samples/app-login/assets/wrong-password.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions samples/app-login/sourcecode/Assets/SampleImage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Content": "Image",
"FileName": "/ctrllib/image/images/SampleImage.svg",
"IsSampleData": true,
"IsWritable": false,
"Name": "SampleImage",
"Path": "/ctrllib/image/images/SampleImage.svg",
"ResourceKind": "Uri",
"RootPath": "ms-appx:///ctrllib/image/images/SampleImage.svg",
"Schema": "i",
"Type": "ResourceInfo"
}
119 changes: 119 additions & 0 deletions samples/app-login/sourcecode/CanvasManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"FormatVersion": "0.24",
"Header": {
"DocVersion": "1.326",
"MinVersionToLoad": "1.326",
"MSAppStructureVersion": "2.0"
},
"Properties": {
"AppCreationSource": "AppFromScratch",
"AppDescription": "",
"AppPreviewFlagsMap": {
"aibuilderserviceenrollment": false,
"allowmultiplescreensincanvaspages": false,
"appinsightserrortracing": false,
"appinstrumentationcorrelationtracing": false,
"autocreateenvironmentvariables": false,
"backfromhostaction": false,
"behaviorpropertyui": false,
"blockmovingcontrol": true,
"cdsdataformatting": false,
"classiccontrols": false,
"consistentreturnschemafortabularfunctions": false,
"copyandmerge": false,
"datatablev2control": true,
"delaycontrolrendering": true,
"delayloadscreens": true,
"disablecdsfileandlargeimage": false,
"disablecommandbar": false,
"dynamicschema": false,
"enableappembeddingux": false,
"enablebarcodereaderfeature": false,
"enablecomponentnamemaps": false,
"enablecomponentscopeoldbehavior": false,
"enableeditcacherefreshfrequency": false,
"enableexcelonlinebusinessv2connector": true,
"enableideaspanel": true,
"enableonstart": true,
"enableonstartnavigate": false,
"enablepcfmoderndatasets": true,
"enablepowerautomatepane": true,
"enablerowscopeonetonexpand": false,
"enablerpawarecomponentdependency": true,
"enablerulespanel": false,
"enablesaveloadcleardataonweb": false,
"enhanceddelegation": true,
"enhancedgalleryinitialization": true,
"errorhandling": true,
"excelcompatibility": false,
"expandedsavedatasupport": true,
"exportimportcomponents2": true,
"externalmessage": false,
"fluentv9controls": false,
"formuladataprefetch": true,
"formularepair": false,
"generatedebugpublishedapp": false,
"herocontrols": false,
"improvedmediacapture": false,
"improvedtabstopbehavior": false,
"keeprecentscreensloaded": false,
"longlivingcache": false,
"namedformulas": false,
"nativecdsexperimental": true,
"optimizedforteamsmeeting": false,
"packagemodernruntime": false,
"parallelcodegen": false,
"pdffunction": false,
"projectionmapping": true,
"reactformulabar": false,
"reliableconcurrent": true,
"reverttooldpowerautomate": false,
"rtlinstudiopreview": false,
"rtlsupport": false,
"tabledoesntwraprecords": false,
"untypedobject": false,
"usedisplaynamemetadata": true,
"useenforcesavedatalimits": true,
"useexperimentalcdsconnector": true,
"useexperimentalsqlconnector": true,
"useguiddatatypes": true,
"usenonblockingonstartrule": true,
"webbarcodescanner": false,
"zeroalltabindexes": true
},
"Author": "",
"ContainsThirdPartyPcfControls": false,
"DefaultConnectedDataSourceMaxGetRowsCount": 500,
"DocumentAppType": "Phone",
"DocumentLayoutHeight": 1136,
"DocumentLayoutLockOrientation": false,
"DocumentLayoutMaintainAspectRatio": true,
"DocumentLayoutOrientation": "portrait",
"DocumentLayoutScaleToFit": true,
"DocumentLayoutWidth": 640,
"DocumentType": "App",
"EnableInstrumentation": false,
"FileID": "1603b631-0c1c-428e-b29c-e1799f0a26fd",
"Id": "1603b631-0c1c-428e-b29c-e1799f0a26fd",
"InstrumentationKey": "",
"LocalDatabaseReferences": "{}",
"Name": "Login Form",
"OriginatingVersion": "1.326"
},
"PublishInfo": {
"AppName": "Login Form",
"BackgroundColor": "RGBA(0,176,240,1)",
"IconColor": "RGBA(255,255,255,1)",
"IconName": "Edit",
"LogoFileName": "",
"PublishDataLocally": false,
"PublishResourcesLocally": false,
"PublishTarget": "player",
"UserLocale": "en-US"
},
"ScreenOrder": [
"Login",
"Wrong Password",
"Home"
]
}
1 change: 1 addition & 0 deletions samples/app-login/sourcecode/ComponentReferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
27 changes: 27 additions & 0 deletions samples/app-login/sourcecode/Connections/Connections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"235dbf9d-6527-4e24-a38c-46d8a569652c": {
"connectionParameters": {
"sku": "Enterprise"
},
"connectionRef": {
"displayName": "SharePoint",
"iconUri": "https://connectoricons-prod.azureedge.net/u/juanq/gateway/greyhound/3000.150.11/1.0.1613.3116/sharepointonline/icon.png",
"id": "/providers/microsoft.powerapps/apis/shared_sharepointonline"
},
"datasets": {
"https://stdntpartners.sharepoint.com/sites/DigitalImageProcessing": {
"dataSources": {
"Login Details": {
"tableName": "e0fcdad0-2a50-48aa-99e2-d3f4a3e682ec"
}
}
}
},
"dataSources": [
"Login Details"
],
"dependencies": {},
"dependents": [],
"id": "235dbf9d-6527-4e24-a38c-46d8a569652c"
}
}
Loading

0 comments on commit 1ba4819

Please sign in to comment.