C# Class JwtWebApi.Controllers.AccountController

Inheritance: ApiController
Exibir arquivo Open project: stewartm83/Jwt-WebApi

Public Methods

Method Description
CreateSalt ( ) : string

Creates a random salt to be used for encrypting a password

EncryptPassword ( string password, string salt ) : string

Encrypts a password using the given salt

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CreateToken ( User user, object &dbUser ) : string

Create a Jwt with user information

CreateUser ( RegisterViewModel registerDetails ) : User

Create a new user and saves it to the database

Login ( LoginViewModel model ) : HttpResponseMessage
Register ( RegisterViewModel model ) : HttpResponseMessage

Method Details

CreateSalt() public static method

Creates a random salt to be used for encrypting a password
public static CreateSalt ( ) : string
return string

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

EncryptPassword() public static method

Encrypts a password using the given salt
public static EncryptPassword ( string password, string salt ) : string
password string
salt string
return string