Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:51:54+00:00 2026-06-11T19:51:54+00:00

With BoilerplateJS setup, what is the recommended way to handle authorization and authentication? Obviously

  • 0

With BoilerplateJS setup, what is the recommended way to handle authorization and authentication?

Obviously on the server-side you’d check cookies etc to know who’s logged in. But, on the client, how would you know if a user is logged in and what their username etc are?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:51:55+00:00Added an answer on June 11, 2026 at 7:51 pm

    I will share how this was done in one of the projects that used BoilerplateJS. On this project we used OAuth 2.0 for authentication.

    • We had a separate login page which was NOT using BoilerplateJS OR complex JS. The reason to keep it separate is that authentication may depend on URL redirection, which is not handled best with JS.

    • Once user is correctly authenticated, we receive the auth_token of the server session and store it as a JS variable. We used ‘settings’ of global Boiler.Context to store this token. Since settings are inherited to child contexts, we were able to access it from any where.

    • For authorization purposes, then we then downloaded a simple ACL for the logged user that contains the authorized access keys. These keys were just for client validations to show/hide controls. Real authorization was performed on backend services.

    • We wanted the BoilerplateJS components to be fully self contained including authentication of it. Therefore if a particular component’s viewmodel receive an unauthorized 401 HTTP response from server (either not logged-in OR or session expiry) we rendered component differently there, without redirecting user to the login page.

    • Since we did not redirect, user was able to make use of other information on the page even the BoilerplateJS component was not actively displaying it’s content. We had a rendered some error information on the component with a link to re-login.

    • Handling of this was done via a generic error handler we created. From component.js, we pass a error callback function to our viewmodel (you may have this on context itself too). This callback function is used by the viewmodel to notify any error occurred within it. In the case of 401 HTTP code, this handler is invoked asking component.js to render UI with error information and a link to re-login.

    • User clicks on the re-login URL to get back to the login page. This URL contains a back reference to the originated URL, such that user is able to get to the page where he was after authentication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a simple base war which includes all the boilerplate setup
What's the minimum boilerplate code required to setup an OpenGL view (with the necessary
I'm currently using backbone boilerplate and running it on my MAMP server localhost. I
I have been trying to setup Symfony2 on Windows so that I can use
What is the best way to create multiple views with different models using the
I have got C2DM setup and working. It also sends the users ID to
I'm looking for a guide for polyglot programming in this two languages. I know
The project i am working at right now requires some declarative way of defining
Regarding the BoilerplateJs example, how should we adjust those modules to be intercommunicate in
I'm trying to incorporate some UI components to a BoilerplateJS project that I'm currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.