Skip to content

SIRA Auth – Node.js service for authenticating Univalle students and teachers and retrieving their information from the SIRA portal.

License

Notifications You must be signed in to change notification settings

code3743/sira-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIRA AUTH

SIRA AUTH is a Node.js application that provides authentication and student information retrieval for the SIRA system of the University of Valle. It uses Express.js for handling HTTP requests and Axios for communicating with external services.

Important

This project is a work in progress. Some features may not be fully implemented yet.


Features

  • User authentication
  • Student information retrieval
  • Teacher information retrieval (in progress)

How to Use

  1. Clone the repository:
git clone https://github.com/code3743/sira-auth.git
  1. Navigate to the project directory:
cd sira-auth
  1. Install dependencies:
npm install
  1. Compile the TypeScript code:
npx tsc
  1. Start the server:
node dist/app.js
  1. The server will be running at: http://localhost:3000

Endpoints

1. Authenticate a user

POST /auth/login – Authenticate a user with their credentials.

curl -X POST http://localhost:3000/api/auth \
-H "Content-Type: application/json" \
-d '{"user": "your_user", "password": "your_password"}'

Response:

{
  "token": "your_token_here",
  "isStudent": true // or false if the user is a teacher
}

2. Retrieve student information

GET /student/info – Returns student information. Requires authentication via token.

curl -X GET http://localhost:3000/api/student/info \
-H "Authorization: Bearer your_token"

Response:

{
    "program" : "CODE PROGRAM",
    "name" : "STUDENT NAME",
    "code" : "STUDENT CODE",
    "email" : "STUDENT EMAIL",
    "document" : "STUDENT DOCUMENT"
}

GET /student/preview/:code – Returns student information preview by code. Does not require authentication.

curl -X GET http://localhost:3000/api/student/preview/STUDENT_CODE

Response:

{
    "program" : "CODE PROGRAM",
    "name" : "STUDENT NAME",
    "code" : "STUDENT CODE",
    "email" : null,
    "document" : null
}

3. Retrieve teacher information (in progress)

GET /teacher/info – Returns teacher information. Requires authentication via token.

curl -X GET http://localhost:3000/api/teacher/info \
-H "Authorization: Bearer your_token"

About

SIRA Auth – Node.js service for authenticating Univalle students and teachers and retrieving their information from the SIRA portal.

Topics

Resources

License

Stars

Watchers

Forks