Class TokenAuthorization
- Namespace
- Dynamicweb.Security.Utilities
- Assembly
- Dynamicweb.Core.dll
Provides methods for performing token-based authorization. This class cannot be inherited.
- Inheritance
-
Token
Authorization
- Inherited Members
Properties
Tag
Gets the name of the request item that is being checked for authorization token presence.
Property Value
Methods
IssueToken()
Issues a new token.
Returns
- string
Token.
IssueToken(bool)
Issues a new token.
Parameters
throwOnError
boolValue indicating whether to throw exception if token cannot be issued.
Returns
- string
Token.
Exceptions
- Invalid
Operation Exception Token cannot be issued.
RemoveTokenDefinition(string)
Removes the token definition from the given URI string.
Parameters
uri
stringURI to remove token definition from.
Returns
- string
URI with removed token definition.
Revoke(IRequest)
Revokes the given authorization token.
Parameters
request
IRequestHTTP request containing token information.
Revoke(string)
Revokes the given authorization token.
Parameters
token
stringToken to revoke.
Validate(IRequest)
Validates the given token.
Parameters
request
IRequestHTTP request containing token information.
Returns
- bool
Value indicating whether the given token is valid.
Validate(string)
Validates the given token.
Parameters
token
stringToken to validate.
Returns
- bool
Value indicating whether the given token is valid.
ValidateAndRevoke(IRequest)
Validates the given token and revokes it right away.
Parameters
request
IRequestHTTP request containing token information.
Returns
- bool
Value indicating whether the given token is valid.
ValidateAndRevoke(string)
Validates the given token and revokes it right away.
Parameters
token
stringToken to validate.
Returns
- bool
Value indicating whether the given token is valid.