Módulo de autenticación OASIS4 para DJANGO©
Este módulo permite a DJANGO© interactuar con OASIS4 y realizar acciones como el registro de usuario y su autenticacíón, utilizando un sistema de dos pasos.
El módulo ofrece tres (3) servicios API para el registro de los usuarios, ingreso al sistema y validación del código de autorización.
Versiones
- 1.1.0: Se elimina la dependencia del paquete zibanu.django.auth para el manejo de las señales. Depende de la versión 1.2.0 de zibanu-django.
- 1.0.7: Incorpora una tarea para la sincronización de los usuarios desde la tabla origen en OASIS4.
- 1.0.5: Corrige un bug que se presentaba con la autenticación anónima derivada de la actualización de librerías.
- 1.0.4: Corrige un bug que creaba el usuario en la tabla de usuarios ignorando el segundo nombre y apellido.
APIs
Registro
Esta API permite realizar el proceso de registro de usuarios. El sistema valida el correo electrónico y el número del documento de identificación del usuario contra los datos que existen en la base de datos de OASIS4©.
El API se accede a través de https:////register/ y recibe como parte de la solicitud HTTP un set de datos en formato JSON con los parámetros requeridos para su funcionamiento.
Parámetros
- customer_id: Número de identificación del cliente
- email: Correo electrónico, debe ser el registrado en OASIS4©.
- password: El password asignado por el usuario en la forma de registro online.
Retorna
El API retorna un objeto Response con el estado HTTP 200 si no existen errores y un objeto JSON.
customer_data = {
"first_name": "",
"last_name": "",
"location": "",
"address": "",
"phone": 0,
"mobile": 0,
"email": "",
"customer_id": 0,
"document_type": 0,
"is_valid": True,
"type": 0
}
data_return = {
"token": "asdasdas",
"data": customer_data
}
Objeto customer_data
- first_name: Nombre o nombres del usuario registrado en la base OASIS4©.
- last_name: Apellidos registrados en la base de datos OASIS4©.
- location: Nombre de la ciudad registrada en la base de datos OASIS4©.
- address: Dirección registrada en la base de datos OASIS4©.
- phone: Número telefónico registrado en la base de datos OASIS4©.
- mobile: Número celular registrado en la base de datos OASIS4©.
- email: Correo electrónico registrado en la base de datos OASIS4©.
- customer_id: Documento de identificación registrado en la base de datos OASIS4©.
- document_type: Tipo de documento registrado en la base de datos OASIS4©.
- is_valid: Indica si el usuario se encuentra válido en la base de datos OASIS4©.
- type: Código del tipo de usuario asociado.
- 0: Sin relación
- 1: Cliente
- 2: Asociado
JSON data_return
Diccionario de datos que se retorna a través del objeto Response HTTP.
- token: Token utilizado para la validación del segundo paso de autenticación
- data: Objeto que contiene los datos básicos del cliente
Login
Este API realiza el proceso de autenticación de los usuarios a través de los parámetros "email" y "password". En caso de que la autenticación sea exitosa, envía el código para el segundo paso de la autenticación.
El API se expone a través de https:////login/ y recibe en formato JSON los siguientes parémtros.
Parámetros
- email: Correo electrónico del usuario, previamente registrado, para la autenticación.
- password: Clave del usuario
Retorna
El API retorna un objeto Response HTTP con estado 200 si no existen errores y un objeto JSON.
data_return = {
"token": "asdkjahs"
}
JSON data_return
Objeto JSON que se envía a través del Response HTTP.
- token: Clave token para validar el código de autorización en el segundo paso.
Validate
Este API realiza el proceso de autenticación con el token y el código de autorización enviado al correo electrónico.
El API se accede a travésde https://
Parámetros
- token: Clave token enviada desde el login o register
- code: Código de autorización enviado al correo electrónico.
Retorna
El API genera un objeto Response basado en la acción originaria y asociada al token. Si es exitoso el procdeso retorna un estado HTTP 200.
- Registro: El API solamente retorna el estado
- Acceso (Login): El API retorna el estado y un objeto JSON.
data_return = {
"token": "asdaskjhiuuh",
"payload": {},
"user": {
"full_name": "",
"document_id": 0,
"type": ""
}
}
- token: Java Web Token generado a partir de la autenticacion HTTP.
- payload: Carga de datos del JWT.
- user: Objeto con los datos básicos del usuario.
- full_name: Nombre completo del usuario
- document_id: Número del documento de identificación
- type: Descriptivo del tipo de relación que contiene el cliente con la entidad.
OASIS4 Authentication Package for DJANGO©
This package allow to DJANGO© interact with OASIS4© and make actions like register and authenticate users for login, with a two steps authentication system.
The package offers three API Endpoints for user registration, login user and authenticate code validation.
Versions
- 1.0.7: Include a task to syn users from OASIS4 entity.
- 1.0.5: Fix a bug with anonymous authentication on login after upgrade libraries.
- 1.0.4: Fix a bug that create the username ignoring second name and first last name.
Endpoints
Register
This endpoint make a user registration process, validating the email and document id with OASIS4 database
The endpoint is https://
Parameters
- customer_id: identification number registered at OASIS4© database for validation purposes.
- email: email previously registered at OASIS4© database.
- password: password entered by user in the registration form.
Return
The endpoint returns a response with HTTP Status 200 if ok and json body.
customer_data = {
"first_name": "",
"last_name": "",
"location": "",
"address": "",
"phone": 0,
"mobile": 0,
"email": "",
"customer_id": 0,
"document_type": 0,
"is_valid": True,
"type": 0
}
data_return = {
"token": "asdasdas",
"data": customer_data
}
customer_data object:
Set of features that represent a customer or partner.
- first_name: First name registered in OASIS4© database.
- last_name: Last name registered in OASIS4© database.
- location: City registered in OASIS4© database.
- address: Address registered in OASIS4© database.
- phone: Phone number registered in OASIS4© database.
- mobile: Mobile phone number registered in OASIS4© database.
- email: Email registered in OASIS4© database.
- customer_id: ID number registered in OASIS4© database.
- document_type: Document type from OASIS4© database.
- is_valid: True if user is valid, otherwise False.
- type: User type in system:
- 0 -> Not relationship with company.
- 1 -> Customer relationship.
- 2 -> Partner relationship.
data_return JSON
Set of values to be returned through HTTP Response.
- token: Token to validate code at second pass authenticate.
- data: Customer data object
Login
This endpoint make a login authentication for users, and send an email with authorization code for second step authentication.
The endpoint is https://
Parameters
- email: Email registered at system to authenticate.
- password: User password
Return
The endpoint returns a response object with HTTP Status 200 if ok and json body.
data_return = {
"token": "asdkjahs"
}
data_return dict
Set of values to be returned through HTTP Response.
- token: Token to validate second step authorization code.
Validate
This endpoint performs the authentication with the token and the authorization code sent to the email.
The endpoint is https://
Parameters
- token: Token received from login or register endpoints.
- code: Authentication code received via email.
Return
The endpoint return a Response based on the action that originates it with HTTP Status 200 if ok.
- Register Action: The endpoint return only status code.
- Login Action: The endpoint return status code (200) and json body.
data_return = {
"token": str(token_data.access_token),
"payload": token_data.payload,
"user": {
"full_name": self.__data.get_full_name(),
"document_id": self.__data.profile.document_id,
"type": self.__data.profile.type
}
}
data_return dict
Set of values to be return via HTTP Response.
- token: Java Web Token to authenticate HTTP Requests.
- payload: Java Web Token payload.
- user: Basic user information
- full_name: User full name
- document_id: Document id of user
- type: Descriptive user type
Metadata
Release files for django-oasis4-auth 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-oasis4-auth-1.1.0.tar.gz | 27.0 kB | Without provenance | Details for django-oasis4-auth-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_oasis4_auth-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_oasis4_auth-1.1.0-py3-none-any.whl |
Total release size: 66.1 kB
Release files / django-oasis4-auth-1.1.0.tar.gz
| Download URL | django-oasis4-auth-1.1.0.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d593701a0a259304fc25cee86dd17196e3021c167cc7c311c3c0c88458f2c69
|
|
BLAKE2b-256 checksum How to use checksums |
b3be354285b560b6f38ff3c07b85e718584d7580c8f20af78d71820b511bd611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.14
|
Release files / django_oasis4_auth-1.1.0-py3-none-any.whl
| Download URL | django_oasis4_auth-1.1.0-py3-none-any.whl |
|---|---|
| Size | 39.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b98de039949bdbabfa6fd9bf828d5b947fae67373077fb73dd7db38cdc3ae219
|
|
BLAKE2b-256 checksum How to use checksums |
23b5504cb13c5ba66cb2febf48d7a8a45bf26048cea49fcdabcea7e700bcbbb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.14
|
Security for django-oasis4-auth 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.