Copyright © 2016 - 2026 SigScale Global Inc.
This module handles Oauth user authentication using textual files or Mnesia databases.
The module implements the OAuth 2.0 authorization framework. Authentication is carried out using a Bearer scheme using JSON Web Token (JWT) instead of using the resource owner's credentials. The JSON Web Token is validated with the certificate for the issuer using JSON Web Key (JWK).
The following environment variables must be configured in the ocs application.
| do/1 | |
| do1/2* | |
| load/2 | Look up a directory and set a new context. |
| store/2 | Check the validity of configuration options and save them in the internal database. |
| handle_auth/4* | |
| require/3* | |
| validate_cert/3* | Validate a JWT certificate. |
| validate_payload/1* | Validate a JWT payload. |
| validate_header/1* | Validate a JWT header. |
| validate_user/6* | |
| user_group_check/5* | |
| get_user_list/2* | |
| decode_base64url/1* | Decode a base64url encoded value. |
| directory_path/2* | Look up the configuration directory. |
| struct_to_map/1* | Convert mochijson struct to a map. |
| struct_to_map/2* |
do(Mod) -> any()
do1(Data, Mod) -> any()
load(Directory, DirectoryData) -> Result
Look up a directory and set a new context.
store(Options, Config) -> Result
Check the validity of configuration options and save them in the internal database
handle_auth(Info, Directory, DirectoryData, AuthType) -> Result
require(Mod, Directory, DirectoryData) -> any()
validate_cert(EncodedHeader, EncodedPayLoad, EncodedSignature) -> Result
Validate a JWT certificate.
validate_payload(EncodedPayload) -> Result
Validate a JWT payload.
validate_header(EncodedHeader) -> Result
Validate a JWT header.
validate_user(Info, Directory, DirectoryData, ValidUsers, ValidGroups, DecodedPayload) -> Result
user_group_check(Info, User, UserGroups, Directory, DirectoryData) -> Result
get_user_list(DirectoryData, Group) -> Result
decode_base64url(EncodedValue) -> DecodedValue
Decode a base64url encoded value.
directory_path(Path, ConfigDb) -> Result
Look up the configuration directory.
struct_to_map(Struct) -> Map
Convert mochijson struct to a map.
struct_to_map(T, Acc) -> any()
Generated by EDoc