├── .github
└── workflows
│ └── mainPackage.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── SimpleAuth.Droid.CustomTabs.nuspec
├── SimpleAuth.Facebook.Droid.nuspec
├── SimpleAuth.Facebook.iOS.nuspec
├── SimpleAuth.Google.Droid.nuspec
├── SimpleAuth.Google.iOS.nuspec
├── SimpleAuth.nuspec
├── ext
└── portable-headers
│ └── System.Net.Http.dll
├── samples
├── .nuget
│ └── NuGet.Config
├── Sample.Droid
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.Designer.cs
│ │ ├── drawable
│ │ │ └── Icon.png
│ │ ├── layout
│ │ │ └── Main.axml
│ │ └── values
│ │ │ └── Strings.xml
│ └── Sample.Droid.csproj
├── Sample.Forms
│ ├── Sample.Forms.Droid
│ │ ├── Assets
│ │ │ └── AboutAssets.txt
│ │ ├── MainActivity.cs
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ ├── AboutResources.txt
│ │ │ ├── Resource.Designer.cs
│ │ │ ├── drawable-hdpi
│ │ │ │ └── icon.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── icon.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── icon.png
│ │ │ └── drawable
│ │ │ │ └── icon.png
│ │ ├── Sample.Forms.Droid.csproj
│ │ └── SimpleAuth.keystore
│ ├── Sample.Forms.UWP
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Assets
│ │ │ ├── LockScreenLogo.scale-200.png
│ │ │ ├── SplashScreen.scale-200.png
│ │ │ ├── Square150x150Logo.scale-200.png
│ │ │ ├── Square44x44Logo.scale-200.png
│ │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ │ ├── StoreLogo.png
│ │ │ └── Wide310x150Logo.scale-200.png
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── Default.rd.xml
│ │ ├── Sample.Forms.UWP.csproj
│ │ ├── Sample.Forms.UWP.nuget.props
│ │ └── Sample.Forms.UWP.nuget.targets
│ ├── Sample.Forms.WinPhone
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Assets
│ │ │ ├── Logo.scale-240.png
│ │ │ ├── SmallLogo.scale-240.png
│ │ │ ├── SplashScreen.scale-240.png
│ │ │ ├── Square71x71Logo.scale-240.png
│ │ │ ├── StoreLogo.scale-240.png
│ │ │ └── WideLogo.scale-240.png
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Sample.Forms.WinPhone.csproj
│ │ └── packages.config
│ ├── Sample.Forms.Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Assets
│ │ │ ├── Logo.scale-100.png
│ │ │ ├── SmallLogo.scale-100.png
│ │ │ ├── SplashScreen.scale-100.png
│ │ │ └── StoreLogo.scale-100.png
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Sample.Forms.Windows.csproj
│ │ └── packages.config
│ ├── Sample.Forms.iOS
│ │ ├── AppDelegate.cs
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Resources
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ ├── Default@2x.png
│ │ │ ├── Icon-60@2x.png
│ │ │ ├── Icon-60@3x.png
│ │ │ ├── Icon-76.png
│ │ │ ├── Icon-76@2x.png
│ │ │ ├── Icon-Small-40.png
│ │ │ ├── Icon-Small-40@2x.png
│ │ │ ├── Icon-Small-40@3x.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ ├── Icon-Small@3x.png
│ │ │ └── LaunchScreen.storyboard
│ │ ├── Sample.Forms.iOS.csproj
│ │ ├── iTunesArtwork
│ │ └── iTunesArtwork@2x
│ └── Sample.Forms
│ │ ├── App.cs
│ │ ├── LoginPage.xaml
│ │ ├── LoginPage.xaml.cs
│ │ ├── Sample.Forms.projitems
│ │ └── Sample.Forms.shproj
├── Sample.Mac
│ ├── AppDelegate.cs
│ ├── AppDelegate.designer.cs
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── MainMenu.xib
│ ├── MainWindow.cs
│ ├── MainWindow.designer.cs
│ ├── MainWindow.xib
│ ├── MainWindowController.cs
│ ├── MainWindowController.designer.cs
│ ├── Resources
│ │ └── Images.xcassets
│ │ │ └── AppIcons.appiconset
│ │ │ ├── AppIcon-128.png
│ │ │ ├── AppIcon-128@2x.png
│ │ │ ├── AppIcon-16.png
│ │ │ ├── AppIcon-16@2x.png
│ │ │ ├── AppIcon-256.png
│ │ │ ├── AppIcon-256@2x.png
│ │ │ ├── AppIcon-32.png
│ │ │ ├── AppIcon-32@2x.png
│ │ │ ├── AppIcon-512.png
│ │ │ ├── AppIcon-512@2x.png
│ │ │ └── Contents.json
│ └── Sample.Mac.csproj
├── Sample.Maui
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── LoginPage.xaml
│ ├── LoginPage.xaml.cs
│ ├── MauiProgram.cs
│ ├── Platforms
│ │ ├── Android
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── MainActivity.cs
│ │ │ ├── MainApplication.cs
│ │ │ └── Resources
│ │ │ │ └── values
│ │ │ │ └── colors.xml
│ │ ├── MacCatalyst
│ │ │ ├── AppDelegate.cs
│ │ │ ├── Info.plist
│ │ │ └── Program.cs
│ │ ├── Windows
│ │ │ ├── App.xaml
│ │ │ ├── App.xaml.cs
│ │ │ ├── Package.appxmanifest
│ │ │ └── app.manifest
│ │ └── iOS
│ │ │ ├── AppDelegate.cs
│ │ │ ├── Info.plist
│ │ │ └── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Resources
│ │ ├── AppIcon
│ │ │ ├── appicon.svg
│ │ │ └── appiconfg.svg
│ │ ├── Fonts
│ │ │ ├── OpenSans-Regular.ttf
│ │ │ └── OpenSans-Semibold.ttf
│ │ ├── Images
│ │ │ └── dotnet_bot.svg
│ │ ├── Raw
│ │ │ └── AboutAssets.txt
│ │ ├── Splash
│ │ │ └── splash.svg
│ │ └── Styles
│ │ │ ├── Colors.xaml
│ │ │ └── Styles.xaml
│ └── Sample.Maui.csproj
├── Sample.iOS
│ ├── AppDelegate.cs
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ └── LaunchScreen.xib
│ ├── Sample.iOS.csproj
│ └── Spinner.cs
├── SimpleAuth.Samples.Windows.sln
└── SimpleAuth.Samples.sln
└── src
├── .nuget
└── NuGet.Config
├── SimpleAuth.Droid.CustomTabs
├── ActivityLifecycleCallbackManager.cs
├── NativeCustomTabsAuthenticator.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ └── Resource.Designer.cs
├── SimpleAuth.Droid.CustomTabs.csproj
└── SimpleAuthCallbackActivity.cs
├── SimpleAuth.Droid
├── ActivityStateRepository.cs
├── App.config
├── AuthStorage.cs
├── LoginActvity.cs
├── Native.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.Designer.cs
│ ├── Values
│ │ └── Strings.xml
│ └── layout
│ │ └── login.axml
├── SimpleAuth.Droid.csproj
├── TypeForwarded.cs
└── WebAuthenticatorActivity.cs
├── SimpleAuth.Facebook.Droid
├── ActivityLifecycleManager.cs
├── Facebook.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ └── values
│ │ └── Strings.xml
└── SimpleAuth.Facebook.Droid.csproj
├── SimpleAuth.Facebook.iOS
├── Facebook.cs
├── Properties
│ └── AssemblyInfo.cs
└── SimpleAuth.Facebook.iOS.csproj
├── SimpleAuth.Google.Droid
├── ActivityLifecycleManager.cs
├── Google.cs
├── Properties
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ └── values
│ │ └── Strings.xml
└── SimpleAuth.Google.Droid.csproj
├── SimpleAuth.Google.iOS
├── Google.cs
├── Properties
│ └── AssemblyInfo.cs
└── SimpleAuth.Google.iOS.csproj
├── SimpleAuth.Mac.sln
├── SimpleAuth.Mac
├── AppleEventsHelper.cs
├── AuthStorage.cs
├── Entitlements.plist
├── Native.cs
├── NativeSafariAuthenticator.cs
├── SimpleAuth.Mac.csproj
└── WebAuthenticator.cs
├── SimpleAuth.Net
├── AuthStorage.cs
└── SimpleAuth.Net.csproj
├── SimpleAuth.Net6
└── SimpleAuth-net6.csproj
├── SimpleAuth.Tests
├── Helpers
│ ├── FakeHttpHandler.cs
│ ├── InMemoryAuthStorage.cs
│ └── RequestMessage.cs
├── OAuth
│ ├── OAuthApiTests.cs
│ ├── OAuthData.cs
│ └── OAuthTestApi.cs
└── SimpleAuth.Tests.csproj
├── SimpleAuth.UWP
├── AuthStorage.cs
├── CustomWebAuthenticationBroker.cs
├── CustomWebAuthenticationResult.cs
├── SimpleAuth.UWP.csproj
├── SimpleAuth.UWP.nuget.props
└── WebAuthenticatorWebView.cs
├── SimpleAuth.iOS
├── App.config
├── AuthStorage.cs
├── BasicAuthController.cs
├── Entitlements.plist
├── Native.cs
├── NativeSafariAuthenticator.cs
├── SimpleAuth.iOS.csproj
├── Twitter.cs
├── TypeForwarded.cs
├── WebAuthenticatorViewController.cs
└── WebAuthenticatorWindow.cs
├── SimpleAuth.sln
└── SimpleAuth
├── Api
├── Account.cs
├── Api.cs
├── ApiResponse.cs
├── Attributes.cs
├── AuthenticatedApi.cs
├── Authenticator.cs
├── JSonExtensions.cs
└── WebAuthenticator.cs
├── ApiKey
├── ApiKeyApi.cs
└── AuthLocation.cs
├── BasicAuth
├── BasicAuthAccount.cs
├── BasicAuthApi.cs
├── BasicAuthAuthenticator.cs
└── IBasicAuthenicator.cs
├── Converters
├── Converter.cs
└── JsonConverter.cs
├── Helpers
├── CookieHolder.cs
├── IAuthStorage.cs
├── Resolver.cs
└── UrlUtility.cs
├── OAuth
├── OAuthAccount.cs
├── OAuthApi.cs
├── OAuthAuthenticator.cs
├── OAuthPasswordApi.cs
├── OauthApiKeyApi.cs
└── OauthResponse.cs
├── Properties
└── AssemblyInfo.cs
├── Providers
├── ADFS.cs
├── Amazon.cs
├── AzureB2CApi.cs
├── DropBox.cs
├── Facebook.cs
├── FitBitApi.cs
├── Github.cs
├── Google.cs
├── Instagram.cs
├── LinkedIn.cs
├── MicrosoftLiveConnectApi.cs
└── Twitter.cs
├── SimpleAuth.projitems
└── SimpleAuth.shproj
/.github/workflows/mainPackage.yml:
--------------------------------------------------------------------------------
1 | name: .NET
2 |
3 | on:
4 | push:
5 | branches: [ "main" ]
6 | pull_request:
7 | branches: [ "main" ]
8 |
9 | jobs:
10 | build:
11 | name: Build SimpleAuth Nuget
12 | env:
13 | NUPKG_MAJOR: 0.2
14 | BASE: 334
15 | NUPKG_SUFFIX: -alpha
16 | runs-on: windows-latest
17 |
18 | steps:
19 | - uses: actions/checkout@v3
20 | - name: Setup .NET
21 | uses: actions/setup-dotnet@v3
22 | with:
23 | dotnet-version: 6.0.x
24 | - name: Add msbuild to PATH
25 | uses: microsoft/setup-msbuild@v1.1
26 | with:
27 | vs-prerelease: true
28 |
29 | - name: Install Maui Workload
30 | shell: pwsh
31 | run: |
32 | & dotnet workload install maui `
33 | --skip-sign-check `
34 |
35 | - name: install Xamarin
36 | shell: pwsh
37 | run: |
38 | dotnet tool install --global boots
39 | boots --stable Xamarin.iOS
40 | boots --stable Xamarin.Mac
41 |
42 | - name: Build
43 | run: msbuild /r src/SimpleAuth.sln
44 |
45 | - name: Nuget Pack step
46 | shell: bash
47 | run: |
48 | MINOR_VERSION=$(( $BASE + $GITHUB_RUN_NUMBER ))
49 | VERSION=$NUPKG_MAJOR.$MINOR_VERSION$NUPKG_SUFFIX
50 | echo "PACKAGE VERSION: $VERSION"
51 | nuget pack SimpleAuth.nuspec -version $VERSION -Symbols -SymbolPackageFormat snupkg
52 |
53 | - uses: actions/upload-artifact@v2
54 | name: Upload Nuget Artifact
55 | with:
56 | name: nuget-artifact.${{env.GITHUB_RUN_NUMBER}}
57 | path: |
58 | **\*.nupkg
59 | **\*.snupkg
60 | **\*.symbols.nupkg
61 |
--------------------------------------------------------------------------------
/SimpleAuth.Droid.CustomTabs.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth.Droid.CustomTabs
5 | 1.0.3
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | Adds CustomTabs support to SimpleAuth
11 | Updated dependencies
12 | James Clancey
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleAuth.Facebook.Droid.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth.Facebook.Droid
5 | 1.0.6
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | Native Facebook support for SimpleAuth
11 | Updated dependencies
12 | James Clancey
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/SimpleAuth.Facebook.iOS.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth.Facebook.iOS
5 | 1.0.7
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | Native Facebook support for SimpleAuth
11 | Added hookeups for Simplified plugins
12 | Required Callbacks:
13 | SimpleAuth.Providers.Facebook.Init(app, options);
14 | SimpleAuth.Native.OpenUrl(application, url, options);
15 | Updated Dependencies
16 | James Clancey
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SimpleAuth.Google.Droid.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth.Google.Droid
5 | 1.0.13
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | Native Google support for SimpleAuth
11 | Updated dependencies
12 | James Clancey
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/SimpleAuth.Google.iOS.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth.Google.iOS
5 | 1.0.4
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | Native Google support for SimpleAuth
11 | Just call
12 | SimpleAuth.Providers.Google.Init();
13 | Required Callbacks:
14 | SimpleAuth.Native.OpenUrl(application, url, options);
15 | Updated dependencies
16 | James Clancey
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SimpleAuth.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Clancey.SimpleAuth
5 | 1.0.56
6 | Clancey
7 | https://github.com/Clancey/SimpleAuth/blob/master/LICENSE
8 | https://github.com/clancey/SimpleAuth
9 | false
10 | The Simplest OAuth client for Xamarin and UWP
11 | Every API needs authentication, yet no developer wants to deal with authentication. Simple Auth embeds authentication into the API so you dont need to deal with it.
12 | Added WKWebView for iOS
13 | James Clancey
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/ext/portable-headers/System.Net.Http.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/ext/portable-headers/System.Net.Http.dll
--------------------------------------------------------------------------------
/samples/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/Sample.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/samples/Sample.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/Sample.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Sample.Droid")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("Sample.Droid")]
14 | [assembly: AssemblyCopyright("Copyright © 2015")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/samples/Sample.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/samples/Sample.Droid/Resources/drawable/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Droid/Resources/drawable/Icon.png
--------------------------------------------------------------------------------
/samples/Sample.Droid/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
18 |
23 |
28 |
--------------------------------------------------------------------------------
/samples/Sample.Droid/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Sample.Droid
5 | 1475840585777919
6 | fb1475840585777919
7 |
8 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 | using Android.Content;
10 |
11 | namespace Sample.Forms.Droid
12 | {
13 | [Activity (Label = "Sample.Forms", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
14 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
15 | {
16 | protected override void OnCreate (Bundle bundle)
17 | {
18 | base.OnCreate (bundle);
19 | SimpleAuth.Providers.Google.Init (this.Application);
20 | global::Xamarin.Forms.Forms.Init (this, bundle);
21 | LoadApplication (new Sample.Forms.App ());
22 | }
23 |
24 | protected override void OnActivityResult (int requestCode, Result resultCode, Intent data)
25 | {
26 | base.OnActivityResult (requestCode, resultCode, data);
27 | SimpleAuth.Native.OnActivityResult (requestCode, resultCode, data);
28 | }
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Sample.Forms.Droid")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("Sample.Forms.Droid")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
32 | // Add some common permissions, these can be removed if not needed
33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
35 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Droid/SimpleAuth.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Droid/SimpleAuth.keystore
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace Sample.Forms.UWP
17 | {
18 | public sealed partial class MainPage
19 | {
20 | public MainPage()
21 | {
22 | this.InitializeComponent();
23 |
24 | LoadApplication(new Sample.Forms.App());
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | FPCL.WIndows
18 | joaqu
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Forms.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Sample.Forms.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Sample.Forms.UWP.nuget.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | C:\Projects\SimpleAuth\samples\Sample.Forms\Sample.Forms.UWP\project.lock.json
7 | $(UserProfile)\.nuget\packages\
8 | C:\Users\Clancey\.nuget\packages\;C:\Program Files (x86)\Xamarin\NuGet\
9 | ProjectJson
10 | 5.0.0
11 |
12 |
13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
14 |
15 |
16 | C:\Users\Clancey\.nuget\packages\newtonsoft.json\10.0.3
17 |
18 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.UWP/Sample.Forms.UWP.nuget.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/Logo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/Logo.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/SmallLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/SmallLogo.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/SplashScreen.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/SplashScreen.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/Square71x71Logo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/Square71x71Logo.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/StoreLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/StoreLogo.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/WideLogo.scale-240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.WinPhone/Assets/WideLogo.scale-240.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
17 |
18 | namespace Sample.Forms.WinPhone
19 | {
20 | ///
21 | /// An empty page that can be used on its own or navigated to within a Frame.
22 | ///
23 | public sealed partial class MainPage
24 | {
25 | public MainPage()
26 | {
27 | this.InitializeComponent();
28 |
29 | this.NavigationCacheMode = NavigationCacheMode.Required;
30 |
31 | LoadApplication(new Sample.Forms.App());
32 | }
33 |
34 | ///
35 | /// Invoked when this page is about to be displayed in a Frame.
36 | ///
37 | /// Event data that describes how this page was reached.
38 | /// This parameter is typically used to configure the page.
39 | protected override void OnNavigatedTo(NavigationEventArgs e)
40 | {
41 | // TODO: Prepare page for display here.
42 |
43 | // TODO: If your application contains multiple pages, ensure that you are
44 | // handling the hardware Back button by registering for the
45 | // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
46 | // If you are using the NavigationHelper provided by some templates,
47 | // this event is handled for you.
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 | FPCL.Windows8.WindowsPhone
12 | joaqu
13 | Assets\StoreLogo.png
14 |
15 |
16 |
17 | 6.3.1
18 | 6.3.1
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Forms.WinPhone.WindowsPhone")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Sample.Forms.WinPhone.WindowsPhone")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.WinPhone/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Assets/Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Windows/Assets/Logo.scale-100.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Assets/SmallLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Windows/Assets/SmallLogo.scale-100.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Windows/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.Windows/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace Sample.Forms.Windows
17 | {
18 | public sealed partial class MainPage
19 | {
20 | public MainPage()
21 | {
22 | this.InitializeComponent();
23 |
24 | LoadApplication(new Sample.Forms.App());
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 | FPCL.Windows8.Windows
10 | joaqu
11 | Assets\StoreLogo.png
12 |
13 |
14 |
15 | 6.3.0
16 | 6.3.0
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Forms.Windows.Windows")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Sample.Forms.Windows.Windows")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.Windows/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace Sample.Forms.iOS
9 | {
10 | // The UIApplicationDelegate for the application. This class is responsible for launching the
11 | // User Interface of the application, as well as listening (and optionally responding) to
12 | // application events from iOS.
13 | [Register("AppDelegate")]
14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
15 | {
16 | //
17 | // This method is invoked when the application has loaded and is ready to run. In this
18 | // method you should instantiate the window, load the UI into it and then make the window
19 | // visible.
20 | //
21 | // You have 17 seconds to return from this method, or iOS will terminate your application.
22 | //
23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
24 | {
25 | global::Xamarin.Forms.Forms.Init ();
26 | LoadApplication (new Sample.Forms.App ());
27 |
28 | SimpleAuth.Providers.Facebook.Init(app, options);
29 | return base.FinishedLaunching (app, options);
30 | }
31 | public override bool OpenUrl (UIApplication app, NSUrl url, NSDictionary options)
32 | {
33 | if (SimpleAuth.Native.OpenUrl (app, url, options))
34 | return true;
35 | return base.OpenUrl (app, url, options);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.3
25 | CFBundleDisplayName
26 | Sample.Forms
27 | CFBundleIdentifier
28 | com.yourcompany.Sample.Forms
29 | CFBundleVersion
30 | 1.0
31 | CFBundleIconFiles
32 |
33 | Icon-60@2x.png
34 | Icon-60@3x.png
35 | Icon-76.png
36 | Icon-76@2x.png
37 | Default.png
38 | Default@2x.png
39 | Default-568h@2x.png
40 | Default-Portrait.png
41 | Default-Portrait@2x.png
42 | Icon-Small-40.png
43 | Icon-Small-40@2x.png
44 | Icon-Small-40@3x.png
45 | Icon-Small.png
46 | Icon-Small@2x.png
47 | Icon-Small@3x.png
48 |
49 | LSApplicationQueriesSchemes
50 |
51 | fbapi
52 | fbapi20130214
53 | fbapi20130410
54 | fbapi20130702
55 | fbapi20131010
56 | fbapi20131219
57 | fbapi20140410
58 | fbapi20140116
59 | fbapi20150313
60 | fbapi20150629
61 | fbauth
62 | fbauth2
63 | fb-messenger-api20140430
64 | fb-messenger-api
65 | fbauth2
66 | fbshareextension
67 |
68 | NSAppTransportSecurity
69 |
70 | NSAllowsArbitraryLoads
71 |
72 |
73 | UILaunchStoryboardName
74 | LaunchScreen.storyboard
75 | CFBundleURLTypes
76 |
77 |
78 | CFBundleURLName
79 | FB
80 | CFBundleURLSchemes
81 |
82 | fbclientid
83 | com.googleusercontent.apps.992461286651-k3tsbcreniknqptanrugsetiimt0lkvo
84 |
85 |
86 |
87 | CFBundleName
88 | Sample.Forms
89 |
90 |
91 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace Sample.Forms.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.Forms.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Sample.Forms.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/iTunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/iTunesArtwork
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms.iOS/iTunesArtwork@2x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Forms/Sample.Forms.iOS/iTunesArtwork@2x
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms/LoginPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms/LoginPage.xaml.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2016 Clancey
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | using System;
16 | using System.Collections.Generic;
17 |
18 | using Xamarin.Forms;
19 | using SimpleAuth;
20 | using System.Windows.Input;
21 | using System.Threading.Tasks;
22 |
23 | namespace Sample.Forms
24 | {
25 | public partial class LoginPage : ContentPage
26 | {
27 | IBasicAuthenicator authenticator;
28 | public LoginPage (IBasicAuthenicator authenticator)
29 | {
30 | this.authenticator = authenticator;
31 | InitializeComponent ();
32 | }
33 |
34 | async void Handle_Clicked (object sender, System.EventArgs e)
35 | {
36 | if (string.IsNullOrWhiteSpace (Username.Text)) {
37 | await this.DisplayAlert ("Error", "Username is invalid", "Ok");
38 | return;
39 | }
40 |
41 | if (string.IsNullOrWhiteSpace (Password.Text)) {
42 | await this.DisplayAlert ("Error", "Password is invalid", "Ok");
43 | return;
44 | }
45 |
46 | try {
47 | bool success = await authenticator.VerifyCredentials (Username.Text, Password.Text);
48 |
49 | if (success)
50 | await this.Navigation.PopModalAsync ();
51 | else
52 | await this.DisplayAlert ("Error", "Invalid credentials", "Ok");
53 |
54 | } catch (Exception ex) {
55 | await this.DisplayAlert ("Error", ex.Message, "Ok");
56 | }
57 | }
58 | protected override bool OnBackButtonPressed ()
59 | {
60 | authenticator.OnCancelled ();
61 | return base.OnBackButtonPressed ();
62 | }
63 |
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms/Sample.Forms.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | 20acc87e-10d0-4ead-a610-b21ed05dbcf4
7 |
8 |
9 | Sample.Forms
10 |
11 |
12 |
13 |
14 | LoginPage.xaml
15 |
16 |
17 |
18 |
19 | MSBuild:UpdateDesignTimeXaml
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/samples/Sample.Forms/Sample.Forms/Sample.Forms.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 20acc87e-10d0-4ead-a610-b21ed05dbcf4
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 | using Foundation;
3 |
4 | namespace Sample.Mac
5 | {
6 | public partial class AppDelegate : NSApplicationDelegate
7 | {
8 | MainWindowController mainWindowController;
9 |
10 |
11 | public AppDelegate()
12 | {
13 | }
14 |
15 | public override void DidFinishLaunching(NSNotification notification)
16 | {
17 | mainWindowController = new MainWindowController();
18 | mainWindowController.Window.MakeKeyAndOrderFront(this);
19 | }
20 |
21 | public override void WillTerminate(NSNotification notification)
22 | {
23 | // Insert code here to tear down your application
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/AppDelegate.designer.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace Sample.Mac
4 | {
5 | [global::Foundation.Register("AppDelegate")]
6 | partial class AppDelegate
7 | {
8 | void ReleaseDesignerOutlets()
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleName
6 | Sample.Mac
7 | CFBundleIdentifier
8 | com.iis.sample-mac
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1
13 | LSMinimumSystemVersion
14 | 10.9
15 | CFBundleDevelopmentRegion
16 | en
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundlePackageType
20 | APPL
21 | CFBundleSignature
22 | ????
23 | NSHumanReadableCopyright
24 | Clancey
25 | NSPrincipalClass
26 | NSApplication
27 | NSMainNibFile
28 | MainMenu
29 | XSAppIconAssets
30 | Resources/Images.xcassets/AppIcons.appiconset
31 | CFBundleURLTypes
32 |
33 |
34 | CFBundleTypeRole
35 | Editor
36 | CFBundleURLSchemes
37 |
38 | com.googleusercontent.apps.992461286651-k3tsbcreniknqptanrugsetiimt0lkvo
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/Main.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 |
3 | namespace Sample.Mac
4 | {
5 | static class MainClass
6 | {
7 | static void Main(string[] args)
8 | {
9 | NSApplication.Init();
10 | NSApplication.Main(args);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/MainWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Foundation;
4 | using AppKit;
5 |
6 | namespace Sample.Mac
7 | {
8 | public partial class MainWindow : NSWindow
9 | {
10 | public MainWindow(IntPtr handle)
11 | : base(handle)
12 | {
13 | }
14 |
15 | [Export("initWithCoder:")]
16 | public MainWindow(NSCoder coder)
17 | : base(coder)
18 | {
19 | }
20 |
21 | public override void AwakeFromNib()
22 | {
23 | base.AwakeFromNib();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/MainWindow.designer.cs:
--------------------------------------------------------------------------------
1 | namespace Sample.Mac
2 | {
3 | [global::Foundation.Register("MainWindow")]
4 | public partial class MainWindow
5 | {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/MainWindowController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Foundation;
4 | using AppKit;
5 | using SimpleAuth.Providers;
6 | using SimpleAuth;
7 | using System.Threading.Tasks;
8 |
9 | namespace Sample.Mac
10 | {
11 | public partial class MainWindowController : NSWindowController
12 | {
13 |
14 | InstagramApi api;
15 | public MainWindowController(IntPtr handle)
16 | : base(handle)
17 | {
18 | }
19 |
20 | [Export("initWithCoder:")]
21 | public MainWindowController(NSCoder coder)
22 | : base(coder)
23 | {
24 | }
25 |
26 | public MainWindowController()
27 | : base("MainWindow")
28 | {
29 | }
30 |
31 | public static string ClientId = "992461286651-k3tsbcreniknqptanrugsetiimt0lkvo.apps.googleusercontent.com";
32 | public static string ClientSecret = "avrYAIxweNZwcHpsBlIzTp04";
33 |
34 |
35 | public override void AwakeFromNib()
36 | {
37 | base.AwakeFromNib();
38 | var scopes = new[]
39 | {
40 | "https://www.googleapis.com/auth/userinfo.email",
41 | "https://www.googleapis.com/auth/userinfo.profile"
42 | };
43 | api = new InstagramApi("instagram",
44 | ClientId,
45 | ClientSecret)
46 | {
47 | Scopes = scopes,
48 | };
49 | }
50 |
51 | public new MainWindow Window {
52 | get { return (MainWindow)base.Window; }
53 | }
54 |
55 | partial void Login (Foundation.NSObject sender)
56 | {
57 | Login();
58 |
59 | }
60 |
61 | async void Login()
62 | {
63 | try
64 | {
65 | var account = await api.Authenticate();
66 | //var info = await api.GetUserInfo();
67 | Console.WriteLine(account.Identifier);
68 | }
69 | catch (TaskCanceledException ex)
70 | {
71 | Console.WriteLine("Canceled");
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/MainWindowController.designer.cs:
--------------------------------------------------------------------------------
1 | // WARNING
2 | //
3 | // This file has been generated automatically by Xamarin Studio to store outlets and
4 | // actions made in the UI designer. If it is removed, they will be lost.
5 | // Manual changes to this file may not be handled correctly.
6 | //
7 | using Foundation;
8 | using System.CodeDom.Compiler;
9 |
10 | namespace Sample.Mac
11 | {
12 | [Register ("MainWindowController")]
13 | partial class MainWindowController
14 | {
15 | [Outlet]
16 | AppKit.NSButton LoginButton { get; set; }
17 |
18 | [Action ("Login:")]
19 | partial void Login (Foundation.NSObject sender);
20 |
21 | void ReleaseDesignerOutlets ()
22 | {
23 | if (LoginButton != null) {
24 | LoginButton.Dispose ();
25 | LoginButton = null;
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-128@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-16@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-256@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-32@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512.png
--------------------------------------------------------------------------------
/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Mac/Resources/Images.xcassets/AppIcons.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/samples/Sample.Maui/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/LoginPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/LoginPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using SimpleAuth;
2 |
3 | namespace Sample.Maui;
4 |
5 | public partial class LoginPage : ContentPage
6 | {
7 | IBasicAuthenicator authenticator;
8 | public LoginPage(IBasicAuthenicator authenticator)
9 | {
10 | this.authenticator = authenticator;
11 | InitializeComponent();
12 | }
13 |
14 | async void Handle_Clicked(object sender, System.EventArgs e)
15 | {
16 | if (string.IsNullOrWhiteSpace(Username.Text))
17 | {
18 | await this.DisplayAlert("Error", "Username is invalid", "Ok");
19 | return;
20 | }
21 |
22 | if (string.IsNullOrWhiteSpace(Password.Text))
23 | {
24 | await this.DisplayAlert("Error", "Password is invalid", "Ok");
25 | return;
26 | }
27 |
28 | try
29 | {
30 | bool success = await authenticator.VerifyCredentials(Username.Text, Password.Text);
31 |
32 | if (success)
33 | await this.Navigation.PopModalAsync();
34 | else
35 | await this.DisplayAlert("Error", "Invalid credentials", "Ok");
36 |
37 | }
38 | catch (Exception ex)
39 | {
40 | await this.DisplayAlert("Error", ex.Message, "Ok");
41 | }
42 | }
43 | protected override bool OnBackButtonPressed()
44 | {
45 | authenticator.OnCancelled();
46 | return base.OnBackButtonPressed();
47 | }
48 | }
49 |
50 |
51 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | namespace Sample.Maui;
2 |
3 | public static class MauiProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 | builder
9 | .UseMauiApp()
10 | .ConfigureFonts(fonts =>
11 | {
12 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
13 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
14 | });
15 |
16 | return builder.Build();
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace Sample.Maui;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace Sample.Maui;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace Sample.Maui;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UIRequiredDeviceCapabilities
11 |
12 | arm64
13 |
14 | UISupportedInterfaceOrientations
15 |
16 | UIInterfaceOrientationPortrait
17 | UIInterfaceOrientationLandscapeLeft
18 | UIInterfaceOrientationLandscapeRight
19 |
20 | UISupportedInterfaceOrientations~ipad
21 |
22 | UIInterfaceOrientationPortrait
23 | UIInterfaceOrientationPortraitUpsideDown
24 | UIInterfaceOrientationLandscapeLeft
25 | UIInterfaceOrientationLandscapeRight
26 |
27 | XSAppIconAssets
28 | Assets.xcassets/appicon.appiconset
29 |
30 |
31 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace Sample.Maui;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace Sample.Maui.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
26 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 | $placeholder$
12 | User Name
13 | $placeholder$.png
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace Sample.Maui;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace Sample.Maui;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Maui/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Clancey/SimpleAuth/4317c3a53e6665014f896788fd8baee02a0bf54b/samples/Sample.Maui/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #512BD4
8 | #DFD8F7
9 | #2B0B98
10 | White
11 | Black
12 | #E1E1E1
13 | #C8C8C8
14 | #ACACAC
15 | #919191
16 | #6E6E6E
17 | #404040
18 | #212121
19 | #141414
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | #F7B548
35 | #FFD590
36 | #FFE5B9
37 | #28C2D1
38 | #7BDDEF
39 | #C3F2F4
40 | #3E8EED
41 | #72ACF1
42 | #A7CBF6
43 |
44 |
45 |
--------------------------------------------------------------------------------
/samples/Sample.Maui/Sample.Maui.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0-android;net6.0-ios;net6.0-maccatalyst
5 | $(TargetFrameworks);net6.0-windows10.0.19041.0
6 |
7 | Exe
8 | Sample.Maui
9 | true
10 | true
11 | enable
12 |
13 |
14 | Sample.Maui
15 |
16 |
17 | com.companyname.sample.maui
18 | 15F94AC1-0174-4D02-8A5F-7E5A8F57836A
19 |
20 |
21 | 1.0
22 | 1
23 |
24 | 14.2
25 | 14.0
26 | 21.0
27 | 10.0.17763.0
28 | 10.0.17763.0
29 | 6.5
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/samples/Sample.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/Sample.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | Sample.iOS
7 | CFBundleIdentifier
8 | com.SimpleAuth.Sample.iOS
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSApplicationQueriesSchemes
14 |
15 | org-appextension-feature-password-management
16 |
17 | LSRequiresIPhoneOS
18 |
19 | MinimumOSVersion
20 | 8.3
21 | UIDeviceFamily
22 |
23 | 1
24 | 2
25 |
26 | UILaunchStoryboardName
27 | LaunchScreen
28 | UIRequiredDeviceCapabilities
29 |
30 | armv7
31 |
32 | UISupportedInterfaceOrientations
33 |
34 | UIInterfaceOrientationPortrait
35 | UIInterfaceOrientationLandscapeLeft
36 | UIInterfaceOrientationLandscapeRight
37 |
38 | UISupportedInterfaceOrientations~ipad
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationPortraitUpsideDown
42 | UIInterfaceOrientationLandscapeLeft
43 | UIInterfaceOrientationLandscapeRight
44 |
45 | CFBundleName
46 | Sample.iOS
47 | CFBundleURLTypes
48 |
49 |
50 | CFBundleURLSchemes
51 |
52 | com.googleusercontent.apps.419855213697-t0usvf1n0j1vd9glogcp33b4d2fnfjhn
53 |
54 | CFBundleURLName
55 | googleLogin
56 |
57 |
58 | CFBundleURLSchemes
59 |
60 | SimpleAuthScheme
61 |
62 | CFBundleURLName
63 | SimpleAuthScheme
64 |
65 |
66 | NSAppTransportSecurity
67 |
68 | NSAllowsArbitraryLoads
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/samples/Sample.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Sample.iOS
4 | {
5 | public class Application
6 | {
7 | // This is the main entry point of the application.
8 | static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, "AppDelegate");
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/samples/Sample.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Sample.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Sample.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("5b67ef19-6479-4ba0-9e01-cfbef0dc4046")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/samples/Sample.iOS/Spinner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Sample.iOS
4 | {
5 | public class Spinner : IDisposable
6 | {
7 | public Spinner (string title)
8 | {
9 | BigTed.BTProgressHUD.ShowContinuousProgress (title, BigTed.ProgressHUD.MaskType.Clear);
10 | }
11 |
12 | #region IDisposable implementation
13 |
14 | public void Dispose ()
15 | {
16 | BigTed.BTProgressHUD.Dismiss ();
17 | }
18 |
19 | #endregion
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/src/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid.CustomTabs/ActivityLifecycleCallbackManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.App;
3 | using Android.OS;
4 | using Android.Support.V4.App;
5 | using SimpleAuth.Droid.CustomTabs;
6 | namespace SimpleAuth
7 | {
8 | internal class ActivityLifecycleCallbackManager : Java.Lang.Object, global::Android.App.Application.IActivityLifecycleCallbacks
9 | {
10 | public Activity CurrentActivity { get; private set; }
11 |
12 | public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
13 | {
14 | CurrentActivity = activity as Activity;
15 | }
16 |
17 | public void OnActivityDestroyed(Activity activity)
18 | {
19 | if (activity == CurrentActivity)
20 | CurrentActivity = null;
21 | }
22 |
23 | public void OnActivityPaused(Activity activity)
24 | {
25 | }
26 |
27 | public void OnActivityResumed(Activity activity)
28 | {
29 | CurrentActivity = activity as Activity;
30 | if (!(activity is SimpleAuthCallbackActivity))
31 | NativeCustomTabsAuthenticator.OnResume();
32 | }
33 |
34 | public void OnActivitySaveInstanceState(Activity activity, Bundle outState)
35 | {
36 | }
37 |
38 | public void OnActivityStarted(Activity activity)
39 | {
40 | CurrentActivity = activity as Activity;
41 | }
42 |
43 | public void OnActivityStopped(Activity activity)
44 | {
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid.CustomTabs/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("SimpleAuth.Droid.CustomTabs")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("SimpleAuth.Droid.CustomTabs")]
14 | [assembly: AssemblyCopyright("Copyright © 2018")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid.CustomTabs/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid.CustomTabs/SimpleAuthCallbackActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using Android.App;
7 | using Android.Content;
8 | using Android.OS;
9 | using Android.Runtime;
10 | using Android.Views;
11 | using Android.Widget;
12 |
13 | namespace SimpleAuth.Droid.CustomTabs
14 | {
15 | public class SimpleAuthCallbackActivity : Activity
16 | {
17 | protected override void OnCreate(Android.OS.Bundle bundle)
18 | {
19 | base.OnCreate(bundle);
20 | Native.OnActivityResult(0, Result.Ok, this.Intent);
21 | Finish();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid/ActivityStateRepository.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace SimpleAuth.Droid
7 | {
8 | ///
9 | /// Object to make passing non serializable objects to Activities easier
10 | ///
11 | public class ActivityStateRepository
12 | where T : Java.Lang.Object
13 | {
14 | readonly Random rand = new Random();
15 | readonly Dictionary states = new Dictionary();
16 |
17 | public string Add(T state)
18 | {
19 | var key = rand.Next().ToString();
20 | while (states.ContainsKey(key))
21 | {
22 | key = rand.Next().ToString();
23 | }
24 | states[key] = state;
25 | return key;
26 | }
27 |
28 | public T Remove(string key)
29 | {
30 | if (states.ContainsKey(key))
31 | {
32 | var s = states[key];
33 | states.Remove(key);
34 | return s;
35 | }
36 | else
37 | {
38 | return default(T);
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/SimpleAuth.Droid/LoginActvity.cs:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2016 Clancey
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | using System;
17 | using System.Collections.Generic;
18 | using System.Linq;
19 | using System.Net;
20 | using Android.App;
21 | using Android.Net.Http;
22 | using Android.Webkit;
23 | using Android.OS;
24 | using System.Threading.Tasks;
25 | using SimpleAuth.Droid;
26 | using Android.Widget;
27 |
28 |
29 | namespace SimpleAuth
30 | {
31 |
32 | [Activity (Label = "Web Authenticator")]
33 | public class LoginActivity : Activity
34 | {
35 | public static string UserAgent = "";
36 |
37 | internal class State : Java.Lang.Object
38 | {
39 | public Authenticator Authenticator;
40 | }
41 | internal static readonly ActivityStateRepository StateRepo = new ActivityStateRepository ();
42 |
43 | State state;
44 | EditText username;
45 | EditText password;
46 | Button login;
47 |
48 | protected override void OnCreate (Bundle savedInstanceState)
49 | {
50 | base.OnCreate (savedInstanceState);
51 |
52 | //
53 | // Load the state either from a configuration change or from the intent.
54 | //
55 | state = LastNonConfigurationInstance as State;
56 | if (state == null && Intent.HasExtra ("StateKey")) {
57 | var stateKey = Intent.GetStringExtra ("StateKey");
58 | state = StateRepo.Remove (stateKey);
59 | }
60 | if (state == null) {
61 | Finish ();
62 | return;
63 | }
64 |
65 | Title = state.Authenticator.Title;
66 | //
67 | // Build the UI
68 | //
69 |
70 | SetContentView (Resource.Layout.login);
71 | username = FindViewById (Resource.Id.username);
72 | password = FindViewById (Resource.Id.password);
73 | login = FindViewById