Questions tagged [authorization]

Verification entails the evaluation of whether a user, program, or device is granted permission to approach a safeguarded asset in a specific manner. It stands as a prominent aspect within computer security protocols.

What are some ways to verify authorization without adding burden to the database?

While working with node.js, I've been considering storing a session id in the session variable to verify user authorization for each page request by checking against the database. However, this approach seems inefficient as it involves a database call ever ...

When making a Get Request from Angular, the header fails to appear for servicing

I am currently working on an angular JS application where I need to call a GET API that is OAuth 2.0 enabled, requiring a Bearer Token in the header for authentication. The method I am using to make the HTTP request is as follows: var config = { heade ...

Confusion surrounding JWT authorization middleware

After reviewing the authentication middleware code in a course I am currently taking, I have some concerns about its security. I decided to test a protected route using Postman and discovered that I was able to retrieve an order for one user with a token ...

User experiencing data loss following JWT refresh

Before diving into the issue, let me share the pertinent code snippets. This is my middleware for authenticating JWT: module.exports.authenticateToken = (req, res, next) => { const authHeader = req.headers["authorization"]; const token = authHeader ...

Combining session and token guard in Laravel 5.2 for simultaneous route access

We previously used session guard for authorization and found it sufficient. Now, we are in need of adding authorization through tokens (either in headers or GET parameters) while still using session authorization on the same routes. The token-based autho ...

Easy steps to include HTTP authentication headers in Spring Boot

I have been customizing my spring boot authorization server to fit my needs. Upon logging in with a username and password from my custom HTML page, I am aiming to redirect back to the /oauth/token endpoint to retrieve the access token. While this process ...

Having trouble with incorporating RBAC in React, facing issues with page rendering post successful login

Struggling to incorporate RBAC into my React application, I have a backend in Node.js that is working well, and for the frontend I'm using Vite and React Router DOM v6. To keep things simple, I decided to store the token and role received from the server i ...

Verifying User Permissions with Angular 2/4 and API

I am currently in the process of developing an Angular 2/4 application that interacts with an API built in Laravel 5.4. One area I'm seeking guidance on involves checking authentication and permissions on the backend through Angular. I want to verify if ...

Unable to deploy Docker image with gcloud app deploy command

I am encountering an issue while attempting to deploy my Node.js application on Google Cloud Platform (GCP) using the Google Cloud SDK. Despite being a beginner, I have been relying on the basic deploy command. gcloud app deploy Everything was running sm ...

Granting permission for a user to access exclusively its own data

Seeking resources and guidance on how to ensure user permissions in API requests. Currently, I am writing middleware for every API to verify user access to requested data. Unable to find a comprehensive guide or tutorial on this topic after scouring the i ...

Enhancing Security Measures for REST APIs

My goal is to create a unified JSON REST API that serves both my javascript web application and external developers. For my web app, I plan to implement user authentication using username/password to access private resources. For external developers acces ...

Securing Access and Privileges within a Product Ecosystem

My product ecosystem consists of multiple products, including an Angular app, a website, and a hybrid app, all powered by a Node backend. Now I want to implement a centralized authentication and authorization system for the entire ecosystem. It needs to b ...

Exploring the basics of Safari 13 authorization through webdriver

Is there a way to fill the basic authorization popup in Safari 13 during an automated session? I need to log in to a website that requires this type of login process. Even a manual solution would be helpful. Can anyone provide guidance on how to achieve th ...

Methods to Exclude api_key from URL in AngularJS

To make a GET request to a REST API, I require an apikey. The request will be formed like this - $http.get() The response from the API will be in JSON format. However, for security reasons, I don't want the api key to be visible in the URL. Is there any ...

Validating Users with OpenID in Vue.js

Utilizing the oidc-client in a basic VueJs project. The IDP server information is correctly configured in SecurityServices.js, with the following oidc config: var mgr = new Oidc.UserManager({ userStore: new Oidc.WebStorageStateStore(undefined), aut ...

Is there a way to transfer cookie information from the SignupPage to the Navbar component using Next.js^9.3?

I've been facing difficulties for the past two days trying to implement authentication. I chose to use Strapi as my headless CMS/backend and nookie for the frontend. During my research, I came across a package called "nookie" from a tutorial that seemed p ...

What could be the reason for receiving a 431 status error after including a JWT token in the Authorization section of the header?

Currently, I am in the process of developing a full stack React application with Express and Node. I have successfully integrated auth0 for authentication and authorization purposes. However, I have encountered an issue and am seeking suggestions on how to ...

Unlocking Spotify: A Guide to Generating an Access Token through Web API Node

I visited the following link for more information: https://www.npmjs.com/package/spotify-web-api-node Here is a code snippet: var SpotifyWebApi = require('spotify-web-api-node'); // credentials are optional var spotifyApi = new SpotifyWebApi( ...

Roles in the Nebular system always have the granted status set to true by default

Hey there, I'm currently setting up Nebular to handle roles. Everything is working fine on the server side, but on the front end side, accessControl.isGranted() always returns true regardless of the role. Here's a snippet of the code I have been ...

Create personalized access tokens through Azure Active Directory (AD)

Currently, I am working on a Next.js application that requires users to log in using their Azure ID. Once logged in, I need to verify the email and other details from the token on my Node.js backend before sending a custom token to the frontend for addit ...

Is it necessary to conceal Angular navigation controls when the user is not authenticated?

In Angular, is there a standardized method for hiding controls when the user is not logged in? We already have the CanActivate guard which checks if a user can access a route. Would it be better to hide the route initially if the user is not logged in or l ...

Inject additional information following user authentication

Hello there! I have successfully developed a REST API using Node.js and StrongLoop, along with an Angular.js based app. After a user logs in, the server sends an accessToken which is stored in cookies. For every request, the accessToken is sent and verif ...

Trouble with retrieving header after implementing logic in Angular 7

Here is the code snippet: app.use((req, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'PUT, GET, DELETE, POST, OPTIONS'); res.header('Access-Control-Allow-Headers', 'Origin, Accept, Con ...

Authorization based on user roles in Node.js or Express.js

Are there any modules available for implementing role-based authorization in node.js or Express js? For example, having roles such as Super Admin, Admin, Editor, and User? ...

Error: Authorization requires both data and salt arguments

As a novice in NodeJS, I attempted to create an authentication form using NodeJS + express. The issue I am facing is regarding password validation - specifically, when "confirmpassword" does not match "password", it should return nothing. Despite my effo ...

Exploring the process of authentication and authorization at individual route levels within Angular 4 using Keycloak

We have successfully integrated Keycloak with our application and the login and logout flow is functioning properly. However, we are facing an issue with authentication and authorization at the route level. When a user clears their browser session or the s ...

Steps to create a private route in Express:

In my current project, I am utilizing a nodejs/express application as the backend solution. This application incorporates passport-jwt to secure specific routes using JWT as the header Authorization. One of these secured routes, known as secure-route, need ...

Implementing conditional button visibility in Angular based on user authorization levels

I've been experimenting with the following code snippet: <button ng-if="!isAuthenticated()" ng-click="deleteReview()">Delete</button> In my JavaScript, I have: $scope.isAuthenticated = function() { $http.get("api/user/getA ...

What is causing the error message "TypeError: expressJwt is not a function" to appear? Is there a way to resolve it and fix the issue?

Authentication with JWT in Node.js: const expressJwt = require('express-jwt') function setupAuth() { const secret = process.env.SECRET_KEY return expressJwt({ secret, algorithms: ['HS256'] }) } module.expor ...