GithubHelp home page GithubHelp logo

auth0-angularjs2-systemjs-sample's Introduction

Deprecation Notice

These samples have been deprecated. Please see the auth0-angular-samples repo for the latest Auth0 and Angular 2+ integration samples.

auth0-angularjs2-systemjs-sample's People

Contributors

alemata avatar amaanc avatar annyv2 avatar chenkie avatar frederikprijck avatar jmangelo avatar ntotten avatar peterblazejewicz avatar sgmeyer avatar tmcw avatar vmartynets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auth0-angularjs2-systemjs-sample's Issues

npm start 01-Login (Samples)

When npm start look this , Help please
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: tsc && concurrently "tsc -w" "lite-server"
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script 'tsc && concurrently "tsc -w" "lite-server" '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && concurrently "tsc -w" "lite-server"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.

could i use SystemJS import Auth0Lock ?

i try to use SystemJS to import auth0-lock, but alway got this error:

EXCEPTION: Error in :0:0 caused by: Auth0Lock is not defined

i knew this sample use <script src="http://cdn.auth0.com/js/lock/10.7/lock.min.js"></script> to load the Auth0Lock, but is there anybody can tell me how to import it by SystemJS?

Google Custom Login not working

I am currently working on a webpage with a Google Custom Login on it. However, when you click the button a tab opens up that says:

  1. That’s an error.

What is the problem?

This is my webpage so far.

02-Custom login - "Login with google" not work

Login with credentials work correctly, buy if we push "Login with google" - no token set and we return to home page.
But when use 01-Login, and auth with "Lock" at same computer and auth.config.ts file - login with google work.

Upd: public handleAuthentication() not return error, because this.auth0.parseHash((err, authResult) => authResult is undefined.
In 'err' we see next:
Object
{ error: "invalid_token"
errorDescription: "Algorithm HS256 is not supported. (Expected algs: [RS256])" }
HS256 is enabled in advanced options by default...

Response to preflight request doesn't pass access control check

Full error:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I am adding auth0 tio my sails angular web app. I have the output of the login component however when i try to login i get this error.

Thanks,

JWT must have 3 parts

I cannot figure out how to fix this error:

Error in ./AppComponent class AppComponent - inline template:10:45 caused by: JWT must have 3 parts

error_handler.js:53Error: JWT must have 3 parts at JwtHelper.decodeToken (angular2-jwt.js:202) at JwtHelper.getTokenExpirationDate (angular2-jwt.js:212) at JwtHelper.isTokenExpired (angular2-jwt.js:221) at tokenNotExpired (angular2-jwt.js:240) at Auth.authenticated (auth.service.ts:27) at _View_AppComponent0.detectChangesInternal (component.ngfactory.js:207) at _View_AppComponent0.AppView.detectChanges (view.js:219) at _View_AppComponent0.DebugAppView.detectChanges (view.js:324) at _View_AppComponent_Host0.AppView.detectViewChildrenChanges (view.js:245) at _View_AppComponent_Host0.detectChangesInternal (host.ngfactory.js:39)

I am using angular 2 and have made sure my app.component.ts / auth.service.ts / appt.module.ts / index.html
match the files here

System Requirements Angular 2.0.1, why the demo code using @angular/core": "2.0.0" ?

System Requirements Angular 2.0.1

"@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "2.0.0",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "angular2-in-memory-web-api": "^0.0.20",
    "angular2-jwt": "^0.1.25",

a2

Template HTML not loading after authentication

Here is my auth service code.

import { Injectable } from '@angular/core';
import { tokenNotExpired } from 'angular2-jwt';
import { myConfig } from '../auth0.config';
import { Router } from '@angular/router'


// Avoid name not found warnings
declare var Auth0Lock: any;

@Injectable()
export class Auth {
  // Configure Auth0
  lock = new Auth0Lock(ClientID,DomainName, {
     auth: {
       redirectUrl: 'http://localhost:4200/server-auth',
       responseType: 'token',
       params: {
         state: 'mologin'
       }
     }
  });

  constructor(private router: Router) {
    // Add callback for lock `authenticated` event
    this.lock.on('authenticated', (authResult) => {
      setTimeout(localStorage.setItem('id_token', authResult.idToken), 200);
      this.router.navigate(['/emails'])
    });
    
  }

  public login() {
    // Call the show method to display the widget.
    this.lock.show();
  };

  public authenticated() {
    // Check if there's an unexpired JWT
    // It searches for an item in localStorage with key == 'id_token'
    return tokenNotExpired();
  };

  public logout() {
    // Remove token from localStorage
    localStorage.removeItem('id_token');
  };
}

On successful routing I'm navigating to my emails page. The email component gets loaded. Its constructor and onInit methods ae called successfully. But the html doesn't gets displayed. Facing this issue on chrome. Working fine on firefox.

Unused function setUser

In 02-Custom-Login/app/auth.service.ts there is a function setUser. It is private and not used anywhere.

Encounter problems installing dependencies

Using npm v 3.10.10, Node 6.9.4.

Executing npm install the following errors occurred:

1.- Deprecated modules:
image

2.- Unmet peer dependency:
image

3.- Warnings at the end:
image

Executing npm install --save auth0-lock:

image

Samples should use auth0-variables.js

Our quickstart samples don't run directly by using values from auth0-variables.js (which is auto-generated for logged in users on the website).

I'll work on a PR to fix this in the coming days.

Angular 2 style guide

I suggest that you use the style guide given by angular.io (specially for the naming convention) for this simples. This will be easier to understand.

With RC5 the authenticated event is not received

Updating to RC% like so:
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",

and also to lock v 10.2.0 the authenticated event does not get fired after calling lock.show and logging in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.