Skip to content

ArmoryNode/BoleroSocialLogins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoleroSocialLogins

Table of Contents


Introduction📄

This is a very basic implementation of using the ASP.NET OAuth2 authentication libraries to allow users to log in with Google and Microsoft in an F# Bolero project. The example code uses a "user info" object to send the user's claims and other data from the server side to the client side.

I mainly created this project because I couldn't find any examples online of someone setting up external logins in Bolero using OAuth2 providers.

Tools and Libraries Used🛠

Getting Started📍

Prerequisites🔍

This project contains the code for setting up Google and Microsoft logins, so you'll need to create app registrations for both to get your client id and client secrets respectively.

💡 If you would rather not implement both, you can remove the registration of the one you don't want from the ConfigureServices method in the server project's Startup.fs, and then remove associated button from the view function in the client project's Main.fs file.

Building and Running Locally👷

  1. Clone the repository
  2. Run dotnet tool restore in the project root, then run dotnet paket install to install dependencies.
  3. Add your Google/Microsoft client id and secret to the server project's User Secrets.
  4. Build and run the project, and click on the buttons to log in to a provider.
  5. You should see your account's name and internal GUID on the home page.

About

My implementation of external OAuth2 logins in F# Bolero

Resources

License

Stars

Watchers

Forks