Skip to content

Form login example #310

Answered by RobertoPrevato
giicoo asked this question in Q&A
Feb 18, 2023 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Hi @Inott-git
There are several ways to implement a strategy to authenticate users. Implementing a full authentication and authorization strategy by yourself can be a good exercise to learn, but also challenging.

First I try to answer to your questions, then later I give you a recommendation.

One option could be:

  1. inside your login request handler, you set a cookie, protected using something like itsdangerous - you can see an example here
  2. your Authentication Handler tries to read and validates, if present, the value of the same Cookie. Its content must give you information about the user who is signed in. BlackSheep includes out of the box a CookieAuthenticationHandler class - see it here.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@giicoo
Comment options

@RobertoPrevato
Comment options

@giicoo
Comment options

@RobertoPrevato
Comment options

@giicoo
Comment options

Answer selected by giicoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants