Questions tagged [authentication]

Authentication is the act of presenting evidence of one's identity or confirming individuality.

Trouble transferring $rootScope.currentUser between AngularJS profile and settings page

I am in the process of setting up a site using Angular, Express, Node, and Passport. Currently, I am configuring Angular to monitor the $rootScope.currentUser variable with the following code: app.run(function ($rootScope, $location, Auth) { // Watch ...

Page access will be protected by authentication

Looking for advice from those experienced with Angular2/ Ionic on how to restrict access to pages only when authenticated. Although there are a few pages that don't require authentication, the majority need it. Is there a way to automatically push the logi ...

Confirming the user's login status using AJAX on the front-end

Currently facing the following issue: I am working on a Rails (version 3.2.8) application that utilizes devise for authentication. The backend is a RESTful API while the front-end consists of a backbone one-page app. Although I have successfully implemen ...

Navigating Basic Authentication on Internet Explorer---How to Manage Basic Authentication

Having trouble with basic authentication on IE9 (platform = WINDOWS 7). Any assistance in resolving the issue would be greatly appreciated. Referenced a blog for guidance, but still facing difficulties. Any help in resolving this problem is welcome. Tha ...

Using Dropwizard and Jersey for authenticating users and passing JSON parameters

Is there a way to create a REST interface method for a resource like the following example? @POST @Consumes(MediaType.APPLICATION_JSON) public void add(@Auth User user, @Valid Food food) { //consume } Unfortunately, attempting to implement this me ...

implementing secure authentication in nodejs with an api

I am currently working on a project that requires authentication through an external application's API. This API returns a response status (either success or failure) along with an access token. What I need is a straightforward authentication process ...

User access is managed through websockets

Currently, I am integrating Websockets into my php project using Ratchet and Symfony. Upon user login, they are automatically connected to a specific channel within the websocket connection. Messages can be pushed to the channel and displayed on the client ...

Leveraging passport.js and direct SQL queries for authentication purposes

Currently tackling a project with an issue that needs resolving. I am looking to integrate user login logic utilizing the Passport API, but struggling to grasp its functionality, especially when implementing it using plain SQL queries. While scouring thr ...

Building a MERN-stack application with user authentication using react-router, all without the need

I am currently in the process of implementing authentication for my application, but I have a specific question. I have set up basic authentication on the backend, generating a token that is then sent to the frontend and stored in a cookie. I have learned ...

Limit entry to a webpage based on the user's category

Greetings, I have successfully implemented a login feature using C# webservice and ajax calls. However, there seems to be a security issue that I need assistance with. In my application, I have two types of users - admin and regular user. The problem arise ...

Symfony equivalent of Auth::attempt

Looking for a straightforward way to authenticate users in Symfony similar to Laravel's Auth::attempt(... method. My user entity already implements AdvancedUserInterface, and I've been reviewing the Symfony security documentation. I'm searc ...

HTML - implementing a login system without the use of PHP

While I am aware that the answer may lean towards being negative, I am currently in the process of developing a series of web pages for an IST assignment in Year 9. Unfortunately, the web page cannot be hosted and our assessor lacks the expertise to utiliz ...

Problem with logging in using ajax

I'm attempting to implement an on-page login feature. It functions perfectly without the use of ajax. Below is my login.php code; if($_POST) { $username =$_POST["username"]; $password =$_POST["password"]; $query = $handler->query("SELECT ...

Ways to utilize and access sessionStorage using middleware in Nextjs

I'm in the process of developing an authentication system for my Next.js app that utilizes the app router. The app features a login route and a user dashboard route. Upon successful login (with the correct username and password), I store the user data ...

Tips for Implementing Authentication in Rest Assured

Struggling to Authenticate the API with Rest Assured? Does anyone have an example of authenticating and authorizing an API using Rest Assured? ...

Accessing protected routes after logging out is possible due to a vulnerability in Next.js version 14.0.4 that allows users

About the Issue: I am currently using Next.js version 14.0.4 for a web application, and I have encountered a problem with browser navigation following user logout. The issue arises when a user logs out and then tries to navigate back using the browser&apos ...

Turn off the authentication middleware for a particular HTTP method on a specific endpoint

Currently, I am using Express/Node and have developed authentication middleware to validate JWT on each request. My requirement is to disable this middleware for a specific route (POST '/api/user/') while keeping it active for another route (GET ...

next-auth consistently redirects when encountering errors with credential providers

I've been working on integrating next-auth with my next js app using the Credentials provider. However, I'm facing an issue where every time a login fails, it automatically redirects to the /api/auth/error route. What I actually want is to handle errors by ...

What is the best way to redirect using Express, EJS, and external JavaScript files?

I am facing an issue with my login form. After collecting the user's email and password, I use JavaScript fetch to send the data to Express. Then, I validate the inputs using express-validator. However, when I try to redirect to another page using res ...

Next JS does not have the ability to access the localStorage in the browser

I am currently in the process of building an application using next JS. While trying to authenticate the user through the login page, I encountered an issue when attempting to retrieve the access token from local storage. The error message "localstorage i ...

jsonAn error occurred while attempting to access the Spotify API, which resulted

Currently, I am working on acquiring an access Token through the Client Credentials Flow in the Spotify API. Below is the code snippet that I have been using: let oAuthOptions = { url: 'https://accounts.spotify.com/api/token', method: 'POST', header ...

Developing a seamless social authentication process using react-native in tandem with a backend API

I'm currently working on developing a mobile app using React Native along with a NodeJS/MongoDB API Backend. One of the key features I want to integrate is social authentication through Google/Facebook, but it's crucial for this process to occur ...

Error message authentication error: "Access token validation failed due to invalid audience"

After struggling with an error for the past two days, I finally found a solution. Despite searching extensively, I could not find a single answer that resolved my issue, but rather multiple answers that collectively led me to the solution. So, let me expla ...

Django: Directing users to the login page upon clicking the star icon for favorites

I'm currently in the process of developing a media server that will feature a small star icon next to each video. By implementing a JQuery event handler, whenever the user clicks on the star button, an AJAX POST request will be sent to the server's favorit ...

Make JQuery send a POST request instead of OPTIONS when making a cross-domain call

Currently, I am facing a challenge where I need to send an ajax POST request (json) to a different domain. However, since I am testing on localhost and do not have access to the server yet, everything is a bit more complicated. Unfortunately, it is not po ...

Sending passwords in the HTTP request body during the spring season. Securely storing user passwords in Java

After creating a node rest API using firebase to handle user login authentication with a JSON payload containing username and password, I am now faced with the challenge of integrating this functionality into my spring application in a secure manner that d ...

Can login data be transferred from the index page to other pages?

Working on a school project involving a Weather info web page has been quite the journey. Most of it is complete, except for one issue that I can't seem to figure out. The index page with login and registration functions is connected to phpmyadmin/mys ...

Ways to refresh the session on the server end

What is the process for updating a session in the server side using authV5 in the most recent update of nextjs? I have attempted the following: import { update } from "@/auth However, I am unable to locate the update function within the auth module ...

Top recommendations for implementing private/authentication routes in NextJS 13

When working with routes affected by a user's authentication status in NextJS 13, what is the most effective approach? I have two specific scenarios that I'm unsure about implementing: What is the best method for redirecting an unauthenticated user (e.g ...

Encountering a mysterious token error in the backend system

Hello, I am facing an issue with using my token in the application after the user logs in as I am receiving an undefined response in the console. Below are the snippets of code I have been working with. How can I modify my code to successfully access the t ...

Securing your Next.js App with Express JWT Authentication

After setting up a /api/login endpoint to handle user login functionality, I created a login.js page to send form data to the login API. The login API authenticates user credentials stored in the database, generates a token, and saves it to a cookie. awai ...

The code below is not working as it should be to redirect to the home page after logging in using Angular. Follow these steps to troubleshoot and properly

When looking at this snippet of code: this.router.navigate(['/login'],{queryParams:{returnUrl:state.url}}); An error is displayed stating that "Property 'url' does not exist on type '(name: string, styles: AnimationStyleMetadata". ...

Assistance needed with securely reading login information from text file using PHP

Here is a snippet of code related to saving registration data to a text file. Now, on the login page, I need to read and verify this data so that users can log in. <?php if (isset($_POST['submit'])) { $name = $_POST['forename']; $password = ...

Learn how to implement Basic Authentication in your Express application using the express-basic-auth package. You can easily trigger login and logout

When it comes to logging out a user who has logged in using basic Auth, I am exploring different options by consulting various sources like: link1 link2 In my application, I have implemented express-basic-auth to secure certain routes. Here is an example ...

Retrieving variables using closures in Node.js

I have been developing thesis software that involves retrieving variables within closures. Below is the code snippet written in node.js: var kepala = express.basicAuth(authentikasi); // authentication for login function authentikasi(user, pass, callback ...

Cookie authentication is effective for verifying users on a desktop platform, whereas it may not be as reliable

My backend is built with express.js and Sequelize, and the authentication route is as follows: exports.signin = (req, res) => { Admin.findOne({ where: { username: req.body.username } }) .then(admin => { ...

Managing User Session Timeout in Ruby on Rails with Devise

My application is utilizing devise for security, with a session timeout set to 30 minutes. Everything works fine when users navigate normally - if they click a link after timing out, they are redirected to the login screen with a message stating "Your sess ...

Navigating Through Internet Explorer Authentication with WebDriver

Has anyone successfully used Webdriver with Python to navigate the User Authentication window in IE? I have received suggestions to use AutoIT, however, I am determined to find a Python-only solution. Despite attempting to utilize python-ntlm, I continue ...

Creating a cookie within nextjs version 14

In developing my Next.js app, I encountered a challenge while setting up the authentication/authorization system. My approach involved using a refresh token with a long duration stored in an httpOnly cookie, along with an access token with a short duration ...

The getSession provided by the getSession function is accessible within getServerSideProps but appears as undefined within the component

Whenever I try to log the session variable inside the Dashboard component, it comes back as undefined. However, when I log it inside the getServerSideProps function, it returns the correct details. Am I missing something here? Objective: My goal is to fet ...

Is there a way to track whether a user has logged into the Google Chrome browser using cookies?

While the LSID cookie can indicate if a user is logged into a Google account, it cannot be reliably used to determine if someone is signed into the Chrome browser because it may also appear when a person is signed into Gmail without being signed into Chrom ...

Whenever using Express JS, an error message that is commonly encountered is: "TypeError: Assignment to constant

I have been working on creating an API with Express JS. The API was running smoothly until I added authorization for some routes using the JsonWebToken package. When I tried to use the token generated by the package, I encountered the following error: Type ...

Is it possible to verify credentials across multiple sources such as a database, Active Directory, and

While I have been using my own authentication and authorization code with Symfony2 as a framework, I recently decided to explore Symfony's security system. Following the tutorial on their website, I successfully set up login using my database. However, no ...

What are the steps to authenticate on Azure Active Directory through LDAP using node.js?

This is all new to me. My users are on AAD and I want to authenticate them using node js. Can anyone provide some guidance on where to begin and the steps to take? ...

Tips for resolving the "Unauthorized 401 error" when accessing JSON data from the back end on a React profile page

My current setup involves utilizing React and Express for this application. React is running on PORT 3000, while Express is running on PORT 3001. Authentication on the Express side is implemented using JWT. Here is an overview of my auth.js service file: ...

iOS authentication token combining PHP

Currently, I am working on an iOS application that requires user login using a unique user ID and password. The existing flow of the process is outlined below: 1) Users input their user ID and password. 2) Upon clicking the login button, a PHP webservice ...

Authentication with Next.js

I'm embarking on my journey with Nextjs and I've hit a roadblock when it comes to setting up the authentication aspect. I know that Nextjs commonly uses NextAuth for handling authentication. My initial instinct was to integrate providers like Google, but I ...

Restricting access to my API to only permit communication with my designated front-end application

Currently working on developing a node/express backend and looking to establish an API that is exclusively compatible with my reactjs frontend (private API). Let's take the example of an e-commerce platform where users can browse products, make selections ...

Secure verification is a critical element within the core component of React JS

Creating a user-based application using Meteor (v1.3) requires strong authentication and authorization mechanisms. I found an insightful example by the author of Flow Router that delves into setting up authentication and authorization using Flow Router. h ...

What are the steps to switch to a root page after a successful sign-in with Ember-Auth?

After successfully implementing Ember-Auth using a pure token based approach, I am facing a challenge in redirecting users to the root of my app once they sign in. Although I know about actionRedirectable (refer to for details), since I am using a pure t ...

Establishing secure login systems in Codeigniter framework

In my project, I have implemented CodeIgniter as the PHP framework. However, there are concerns about its vulnerability in the login process, with someone claiming they can easily log in without a password. Currently, I am only using MD5 hashing for secure ...

Access information through token-based verification

Just starting out in this area of development, a colleague shared some information with me on how to retrieve the database. I'm feeling a bit lost as to what to do next. curl -X GET -H "Authorization: Token token=xxxxxxxxxxxxxxxxxxxxxxxxx" "https://www.ex ...

Mongoose encountered an error when trying to convert the value "me" to an ObjectId at the path "_id"

Although there have been multiple versions of this question, I couldn't find a helpful solution. function isAuthenticated() { return compose() // Validate jwt .use(function (req, res, next) { // allow access_token to be passed through ...

Node.js - Retrieving user information upon login in the front-end

I've successfully built a couple of expressjs applications in the past, but I'm currently struggling to figure out how to pass the User Model to the front-end or include it in the req as a parameter. The app functions as a one-page web applicati ...

Is it possible to use Ajax to prompt a pop-up window for basic authentication when logging in?

While attempting to access the reed.co.uk REST web API in order to retrieve all related jobs, I am encountering an issue. Despite passing my username and password, a popup window keeps appearing when I call the URL. The alert message displayed reads: i ...

Building a React Native authentication system using Next.js and NextAuth

I currently have a website that has authentication functionality implemented using Next.js, NextAuth, Prisma, and MySQL. My next step is to develop a React Native app for this website, but I'm uncertain about how to handle authentication. Should I utilize ...

The ideal method to transmit reactive data effectively is through Vue.js

Implementing vue.js. I've created an authentication file (auth.js) that stores the user information upon detecting a change in authentication state. There are other sections of the website that need to update when the user information changes. What is ...

The login request through Express and Passport does not complete or finalize

I have implemented authentication in my express app using passport, passport-local and passport-jwt. The login code below generates a token which is then sent back via the response object. However, when attempting to login using Postman, the request never ...

How can we use SWR to fetch user data conditionally based on their logged-in state?

I am facing an issue with setting the UI state based on whether a user is logged in or not. The UI should display different states accordingly. I am currently using SSG for page generation and SWR for user data retrieval. However, I noticed that when call ...

Top authentication approach for Ruby on Rails API-only server, paired with ActiveAdmin

I'm currently working on a project that involves developing the frontend in Next.js using the fetch API for requests, and the backend in RoR. The challenge I'm facing is setting up user authentication. After some research, I've come across four possible so ...

Meteor, enhanced with the dynamic Iron Router module and integrated

I am working on a project using Meteor (Meteor.com) and I want to incorporate iron-router for the page routing along with the pre-existing accounts-ui package for login functionality. Previously, my {{loginButtons}} functioned properly, but ever since I i ...

Upcoming verification with JSON Web Token

I am looking to incorporate JWT auth into my Next app. Currently, I have mapped out the flow as such: User enters email and password to log in Server responds with status 200 and a jwt access token in httpOnly cookies My main dilemma lies in deciding on ...

Python and Selenium are struggling to locate an element that should be clearly visible

I'm currently working on a project in Python using Selenium to extract data from the following website: However, I've encountered an issue where after entering the username and password, the "Submit" button does not seem to work. I would greatly ...

NodeJS Express Double Authentication using JSON Web Tokens

Currently, I am in the process of developing an express server that enables users to authenticate using two third-party services: Google and Steam. The authentication is accomplished through JWT and functions well when only one service is active. However, ...

What steps can I take to resolve the hydration issue with the authenticating component?

My current setup involves an authentication component that verifies whether the user has a token stored in local storage. Below is a snippet of the code: import { useRouter } from "next/router"; import { useState } from "react"; const ...

Tips for implementing validation in JavaScript

I'm brand new to learning Javascript. Recently, I created a template for a login page and it's working perfectly fine. However, I am struggling with setting up validation and navigation. My goal is to redirect the user to another page if their username is ...

Next client unable to locate cookies in Go web server

I recently updated the authentication method for my Go web server from using Bearer tokens to utilizing cookies. During the login process, I now set a cookie for both the token and refresh token like this: a.AuthRepo.StoreInCookie(res.Token, "token&qu ...

Instructions on creating a PHP file key that automatically expires after 10 days, preventing other users from accessing the API once the key has expired

My goal is to create a key that remains valid for 10 days from the date of generation. This key should allow anyone to access an API for a period of 10 days. I specifically want to implement this functionality using PHP only, without relying on sessions or ...

After logging in successfully, the React app needs a hard refresh to update the

I'm encountering a debugging challenge and would appreciate any assistance from the community. I've been working on my first React app and successfully implemented a Login feature, but after a user logs in, they have to hard refresh their browser ...

Utilize the power of mechanize to access your Megaupload account securely

I am working on a code to log into megaupload. I'm stuck on how to verify that the login was successful. Even though I print out the current URL at the end of the code, all it returns is www.megaupload.com when I run the script. import mechanize import ...

Tips for creating a cURL request with basic authentication in Laravel version 8

I am working with the PayPal Payout SDK and using the code below to obtain access tokens from the PayPal API. curl -v POST https://api-m.sandbox.paypal.com/v1/oauth2/token \ -H "Accept: application/json" \ -H "Accept-Language: ...

The Clerk fails to secure confidential paths in Next.js

When it comes to handling authentication in my app, I've implemented protected routes using Clerk's middleware: import { authMiddleware } from "@clerk/nextjs"; export default authMiddleware({ publicRoutes: ["/sign-in", "/sign-up ...

Express and Mongoose Server Crash resulted in an ERR_HTTP_HEADERS_SENT issue

Currently, I am developing a user authentication backend using express and mongoose. My main focus right now is enabling users to update their name and email address. To achieve this, I am implementing a system where the email input is cross-checked with ...

What are the reasons why emails are not being sent in CodeIgniter?

My email function using CodeIgniter Version 2.2.1 is encountering errors. Below is the PHP code snippet: $config = array( 'protocol'=>'smtp', 'smtp_host'=>'ssl://smtp.googlemail.com&a ...

Secure your browsing experience with AngularJS authentication prompt

Currently, I am working on building an application using AngularJS for the front-end and JavaEE for the back-end. In my AngularJS application, I am trying to access a REST resource provided by the back-end which is protected with JAAS authentication, allow ...