Giter Site home page Giter Site logo

auth0-samples / auth0-winformswpf-oidc-samples Goto Github PK

View Code? Open in Web Editor NEW
21.0 26.0 21.0 82 KB

Auth0 OIDC Client with Windows Forms / WPF applications

License: MIT License

C# 100.00%
auth0 community-driven open-source csharp winforms wpf oidc identity security quickstart

auth0-winformswpf-oidc-samples's Introduction

Auth0 WinFormsWPF OIDC Samples

All Contributors

Contributors

Thanks goes to these wonderful people who contribute(d) or maintain(ed) this repo (emoji key):

Conrad Sopala
Conrad Sopala

🚧 πŸ‘€
Damien Guard
Damien Guard

🚧 πŸ’»
Vladyslav Martynets
Vladyslav Martynets

πŸ’»
Alexis Luque
Alexis Luque

πŸ’»

Intro

Samples for using the Auth0 OidcClient with Windows Forms / WPF applications

This repo is supported and maintained by Community Developers, not Auth0. For more information about different support levels check https://auth0.com/docs/support/matrix .

Contribute

Feel like contributing to this repo? We're glad to hear that! Before you start contributing please visit our Contributing Guideline.

Here you can also find the PR template to fill once creating a PR. It will automatically appear once you open a pull request.

Issues Reporting

Spotted a bug or any other kind of issue? We're just humans and we're always waiting for constructive feedback! Check our section on how to report issues!

Here you can also find the Issue template to fill once opening a new issue. It will automatically appear once you create an issue.

Repo Community

Feel like PRs and issues are not enough? Want to dive into further discussion about the tool? We created topics for each Auth0 Community repo so that you can join discussion on stack available on our repos. Here it is for this one: auth0-winformswpf-oidc-samples

License

This project is licensed under the MIT license. See the LICENSE file for more info.

What is Auth0?

Auth0 helps you to:

or enterprise identity systems like:

  • Windows Azure AD

  • Google Apps

  • Active Directory

  • ADFS

  • Any SAML Identity Provider

  • Add authentication through more traditional username/password databases

  • Add support for linking different user accounts with the same user

  • Support for generating signed JSON Web Tokens to call your APIs and create user identity flow securely

  • Analytics of how, when and where users are logging in

  • Pull data from other sources and add it to user profile, through JavaScript rules

Create a free Auth0 account

  • Go to Auth0 website
  • Hit the SIGN UP button in the upper-right corner

auth0-winformswpf-oidc-samples's People

Contributors

alexisluque avatar allcontributors[bot] avatar chenkie avatar damieng avatar frederikprijck avatar jerriep avatar konradsopala avatar lbalmaceda avatar stevehobbsdev avatar vmartynets avatar widcket avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auth0-winformswpf-oidc-samples's Issues

NETSDK1135: SupportedOSPlatformVersion 10.0.18362.0 cannot be higher than TargetPlatformVersion 7.0.

Issue Report

If you are reporting a bug, please fill the sections below (if they are applicable), otherwise feel free to delete those that don't apply. Thank you! πŸ™πŸΌ

Description

What are you reporting?

NuGet Package "Auth0.OidcClient.WinForms" Version="3.2.7" does not work.

Expected behaviour

  • Create new .NET Core 6.0 WinForms App
  • Add Nuget Package Auth0.Oidc.Client.WinForms
  • Builds sucesfully.

Actual behaviour

  • When you build the .NET Core 6.0 version you, get the build error as soon as you add the nuget package, even before you add any code to empty WinForms .NET Core Project.

  • Works fine with .NET Full Fat Framework 4.8

  • Severity Code Description Project File Line Suppression State
    Error NETSDK1135 SupportedOSPlatformVersion 10.0.18362.0 cannot be higher than TargetPlatformVersion 7.0. WinFormsAppCore6 C:\Program Files\dotnet\sdk\7.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 188

Tell us what actually happens.

As above.

Steps to reproduce the problem

Tell us what we should do to reproduce the issue.

As Above.

Language / Framework Versions

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWindowsForms>true</UseWindowsForms>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

Testing environment

  1. Operating system:

OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22621 N/A Build 22621
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free

Screenshots

None.

Hey there our community developer! πŸ‘‹ We've got improvements for you! πŸ”§

Hey there our Auth0 Community OSS Collaborators!

πŸ‘‹ Long time no see!

As you may have seen some time ago, we communicated the fact that we are gradually working on improving your developer experience inside any repo in this org!

If you go to the readme file of this repository, in the first section you can see a note that this repo is supported and maintained by Community Developers, not Auth0. Despite the fact that we have limited bandwidth inside Auth0 Community Team and are not able to effectively review issues and PRs you submit, we want to improve your experience here one step at a time! That's why you should keep reading!

πŸš€ Auth0 Community Job Offers

If you feel like joining us on a mission to make other developers contributions here more comfortable, here are the links you should visit!

πŸ› οΈ Auth0 Community GitHub org - improvements

We're aiming at your successful developer experience in the long term that's why we introduced a few improvements in the meantime and are looking forward to make even more impact!

  • We created a getting-started repo so that you can answer any of your questions before contributing to our community OSS repos!
  • We added Code of Conduct so that everyone can collaborate in a peaceful and effective way!
  • Wondering how to contribute to our repositories?! Got you covered! We added a Contribution Guideline to easily get you started with your commits and PRs!
  • Additionally we added License files to every repo!

Think it's all?! Nah! We ain't stoppin here! ✨

  • We introduced issues and PRs labels so you can add them to your contributions and other community developers can easily track and choose which ones they would like to help with!
  • The last thing we want to let you know about are Auth0 Community Project Boards. Using them we aim at providing better searchability for people with certain language experience looking to solve stuff in their language of choice and not looking for specific PRs / issues!

❀️ Feedback

Let us know what you think! We're super stoked for your feedback! You can share it here or email us at [email protected]. We know there's a long way ahead of us to make this environment friendly and sustainable but we strongly believe that getting aboard together will let us reach the final destination!

no readme's

(AUTH-4147)
Samples doesn't contain readme.md file.

Prefill email field

I am trying to get the Auth0 client to prefill the email field by passing a dictionary to the Task LoginAsync(object extraParameters = null) according to this https://auth0.com/docs/libraries/lock/lock-configuration#params-object it should be possible, but its unclear how to achieve this within c# wpf.

I have tried using the following as the "extraParameters":

But neither have any impact, is there a way to do this?

Please add how to get refresh token

Issue Report

You have to add
extraParameters.Add("scope", "openid offline_access");

before you call LoginAsync or you will get error "id token not contained in result"

Note the "openid" parameter which is not mentioned anywhere in the documentation.

blocked by google gmail

Issue Report

Description

can not use login with google

Actual behaviour

it transfering to :https://support.google.com/accounts/answer/7675428

Steps to reproduce the problem

login with some random gmail account - it looks like gmail enforce the new policy on specific accounts..

Language / Framework Versions

  1. C# - WPF
  2. .Net 4.2.6

Testing environment

  1. Win 10 + Server 2016

Screenshots

image

Update Microsoft.IdentityModel.Protocols.OpenIdConnect dependency in Auth0.OidcClient.Core

Checklist

  • I have looked into the Readme (WPF/WinForms) and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

Is it possible to update the Microsoft.IdentityModel.Protocols.OpenIdConnect dependency in the Auth0.OidcClient.Core project.(https://www.nuget.org/packages/Microsoft.IdentityModel.Protocols.OpenIdConnect/7.2.0#supportedframeworks-body-tab)
This to avoid to have to update this ourselfs and make this a "top-level" package instead of "transitive" package in our projects.
The current version that is targeted (6.12..2 has vulnerabilities)
Thank you.

Reproduction

Install the package and view dependencies or view dependencies in Nuget.org

Additional context

No response

Windows version(s)

No response

LoginAsync hangs in admin mode

Issue Report

If you are reporting a bug, please fill the sections below (if they are applicable), otherwise feel free to delete those that don't apply. Thank you! πŸ™πŸΌ

Description

Hi ,
I am using native winform application from here to login to my web page . Auth0 WPF / Winforms SDK Quickstarts: Login.

If I run the application normally everything works fine and I am getting token from my web server. but if I run the application in admin mode , it hangs after this call forever,

await client.LoginAsync(extraParameters: extraParameters).

Can anyone please help me with this.

Expected behaviour

It should login and return token.

Actual behaviour

It hangs forever.

Steps to reproduce the problem

Create exe out of winform application with required credentials for login. run the exe in normal mode . It will work fine . Run the exe in admin mode "Run as Administrator" it hangs forever.

Language / Framework Versions

1 .Net version 4.6.2

Testing environment

  1. windows 10

Filling this, you're helping yourself and repo maintainers in solving your issues quicker! Teamwork makes the dreamwork πŸ€œπŸΌπŸ€›πŸ»

Error Loading discovery document: Issuer name is missing

I am receiving the following error when using the Auth0.OidcClient.WinForms assembly (3.2.8) in a ASP.NET Web Application targeting .NET 4.8:

Error Loading discovery document: Issuer name is missing

It's a simple implementation of the example code:

private Auth0Client client;

client = new Auth0Client(new Auth0ClientOptions
{
Domain = "{DOMAIN}",
ClientId = "{CLIENTID}"
});

await client.LoginAsync(); // this is where it fails

Is this a known issue? Are there any resolutions?

Cannot run compiled exe

Description

After cloning the repo I opened and build the WPFSample solution successfully. Then I tried to Start a debug session and gett the following error:
image

When I try to run the WPFSample.exe manually:
image

I have sufficient permissions:
image

Steps to reproduce the problem

Clone repo, open in VS 2019, build and press F5

Mismatched IdToken expiration date with the reported IdTokenExpiresAt property

When using the LoginAsync call, an Auth0User is successfully returned, along with a valid IdToken, however the IdTokenExpiresAt doesn't match the IdToken's embedded expiration date and time.

Call
Dim myUser As Global.Auth0.Windows.Auth0User = Await client.LoginAsync(ParentForm,, , myParams, True, strDevice)

Partial Results (myUser serialized to Json)
"Auth0AccessToken": "Fam1mw..",
"IdToken": "eyJ0eXAiOiJKV...",
"IdTokenExpiresAt": "9999-12-31T23:59:59.9999999",
"Profile": {

It looks like a default value versus a populated value.

Is this an issue you see?

thx
Chris

Application is stuck after calling LoginAsync

Issue Report

Description

What's going wrong is that the application, WindowsFormSample, is stuck after calling LoginAsync

var result = await client.LoginAsync();

It does not give an error or any kind of result. This happens only when I use Visual Studio 2019 as an admin. If I don't use Visual Studio as an admin it works fine. You might expect it to be the otherway around, but a collegue tested it as well and got the same result.

Steps to reproduce the problem

I cloned the WindowsFormSample and updated the .Net version to 4.7.2. Then I updated the Nuget Package Auth0.OidcClient.WinForms to version 3.1.2.

When I downgrade Auth0.OidcClient.WinForms to 2.4.1. it works fine, admin or no admin.

I'd appreciate any help on this.

Invalid request when running sample Windows Form

Issue Report

If you are reporting a bug, please fill the sections below (if they are applicable), otherwise feel free to delete those that don't apply. Thank you! πŸ™πŸΌ

Description

When running the sample WindowsFormsSample application by plugging in my Domain and ClientID and selecting any of the connection options, I get back an "invalid_request" response. No other information is provided and I can't track down what the problem is. I've re-created my Auth0 native application through their dashboard, added the allowed callback URL, and triple checked the domain and client id.

Expected behaviour

Login window should display.

Actual behaviour

Error is thrown "invalid_request."

Steps to reproduce the problem

Run the WindowsFormsSample app in this repository.

AccessToken Invalid Signature

Issue Report

I need to build a desktop application for existing website made using React frontend and Node Backend.

I need to make Http Request to a Server written in NodeJs but it throws an error 401(Unauthorized) when I try to get Token from the website The accesstoken is different
The AccessToken which I get using the example is showing Invalid Signature when I try to verify it using jwt.io

AuthZ Extension Switching to Auth0 Core Losing Scope

Checklist

  • I have looked into the Readme (WPF/WinForms) and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

With the upcoming deprecation of AuthZ Extension, we're looking to move our WPF Application over to using Auth0 Core/Groups. I've followed along with documentation with a completely barebones, stand-alone WPF app that just contains the Auth0.Oidc.WPF nuget client and I'm able to get a successful authentication of my access token and returned user token with Individual login option, but the moment I switch to Organization the scope seems to be completely missing and I get an unauthenticated error return code (openid profile email are all missing in the logs when I switch to orgs).

Reproduction

Here's a general overview of how I'm setting up the client:

            var auth0Client = new Auth0Client(new Auth0ClientOptions
            {
                Domain = "{my_domain}",
                ClientId = "{my_clientId}",
                Scope = "openid email profile",
            });
            loginResult = await auth0Client.LoginAsync(new { audience = "{my_audience}" });

Again, this works fine for individual login, but fails the moment I switch to orgs, which leaves me scratching my head. I am using the most up-to-date nuget package available, and only have these lines for my entire test app. Any help would be appreciated, thank you!

Need to store extra user data, like expiry date, type of package

  1. How to store extra user data like expiry date? and how to check it when user login is in process(In guess in Rules)?

  2. And will it be possible to restrict Multiple login from same credentials? means if user is logged in Terminal A, and if again he tries to log in Terminal B, he should be logged in, but Terminal A should be logout automatically.

  3. Activation of user should be done after Admin allows, not right after SignUp
    i am trying in WPF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.