Auth0 Home Blog Docs

Allow access to single page in app?



Hey guys,
My website is currently only accessible by login in through Auth0 but I want to make a single page accessible without authentication, a way for anyone to type in a specific URL and not have to log in. How can I do this?



You need to provide more information for anyone to be able to help you.

  • What type of app is it? SPA? Regular web app?
  • What framework/technologies is it using?
  • What Auth0 SDK’s are you using?

  1. It’s an SPA
  2. I am using AngularJs
  3. Angular-JWT, auth0-lock


Please refer to the Quickstart:

To protect a route, you define a function to check authentication, then call this onEnter. To leave a route unprotected, simply don’t call this in the onEnter hook:

  // ...
  .state('ping', {
    url: '/ping',
    controller: 'PingController',
    templateUrl: 'app/ping/ping.html',
    controllerAs: 'vm',
    onEnter: checkAuthentication // This protects the route. Simply don't call this to leave it unprotected.

// ...

function checkAuthentication($transition$) {
  var $state = $transition$.router.stateService;
  var auth = $transition$.injector().get('authService');
  if (!auth.isAuthenticated()) {
    return $'home');