Ionic 3 Angular 4 PHP Token Based Restful API User Authentication Login and Signup.

Поделиться
HTML-код
  • Опубликовано: 20 июн 2017
  • PHP Restful API Authentication Login and Signup using Ionic 3 and Angular 4.
    Next Part: • Ionic 3 Angular 4 JSON...
    Resource link: www.9lessons.info/2017/06/ioni...
  • НаукаНаука

Комментарии • 141

  • @DarioCorno
    @DarioCorno 6 лет назад +2

    Very good tutorial! Current version of Ionic takes care of importing new providers, so you don't need to import it manually.

  • @adegams
    @adegams 7 лет назад

    Hi, Very good tutorial. I'am a french people and i like very much. continue in this way

  • @sephyshen2510
    @sephyshen2510 6 лет назад

    Great lesson. Thank you Srinivas.

  • @abijithajayan5611
    @abijithajayan5611 6 лет назад

    Very Good explanation.... Excellent. Thank you so much Sir.

  • @punichennai
    @punichennai 6 лет назад

    great lesson!!!

  • @AnkitkumarChheda
    @AnkitkumarChheda 7 лет назад

    Excellent tutorials.. You earned one more subscriber... *thumbs up*

  • @herbertk9266
    @herbertk9266 7 лет назад

    Thks Tamada this video is so usefull to me so you got another subscriber

  • @kiroshanthayaparan3754
    @kiroshanthayaparan3754 6 лет назад

    Thank you sir. It's working fine. Good job

  • @ashishrprastogi
    @ashishrprastogi 7 лет назад

    Excellent tutorials..

  • @bharathfeb14
    @bharathfeb14 7 лет назад

    great job.... keep post more videos

  • @lucianaelisa9501
    @lucianaelisa9501 5 лет назад

    Very useful! Thanks

  • @malinayir8675
    @malinayir8675 6 лет назад

    You are the best!

  • @utpaulsarkar9694
    @utpaulsarkar9694 7 лет назад

    nice tutorial....

  • @Drt669
    @Drt669 6 лет назад

    This always returns a '200 OK' so never errors. How do you pass an error response in slim, whilst Echoing out?
    It always allows access.

  • @igor9919
    @igor9919 6 лет назад +5

    For everyone having the JSON error, I'm not sure if this is the correct solution, but I got it without errors by doing this:
    1 - go to your index.php in the api folder
    2 - check the signup function: function signup()
    3 - delete or comment the following 'echo' lines:
    echo $email_check.''.$email;
    echo 'here';
    4 - save the index.php
    5 - refresh the app and try again

    • @arnoldkouya
      @arnoldkouya 6 лет назад

      Thank +Igor ;)

    • @kaylrabanzo8425
      @kaylrabanzo8425 6 лет назад +1

      i got this error from XHR please help
      {error: {text: "Enter valid data"}}
      error
      :
      {text: "Enter valid data"}
      text
      :
      "Enter valid data"

  • @azharuddinmulani7265
    @azharuddinmulani7265 7 лет назад

    Helpfull......................

  • @naimmuhammad8946
    @naimmuhammad8946 6 лет назад +1

    How do i fix Unexpected token S in JSON at position 17 in signup() function?

  • @akhedy4905
    @akhedy4905 6 лет назад

    wow thank you, i'll try later

  • @Un1xCr3w
    @Un1xCr3w 6 лет назад

    why u didn't use the @output to emmit the data to parent component instead of storing them in the localStorage ?

  • @umeshshelke725
    @umeshshelke725 6 лет назад +1

    anyone facing this problem : after generating .apk file and opening it it displays white screen only ..no login form no sign form ..but in browser it's work well ..when am testing my app in ionicDevApp it gives me "syntex error" : "unexpected token Illegal" please help me .. my xampp is open and started on my pc

  • @MrLudo3211
    @MrLudo3211 6 лет назад

    bonjour,
    je n'arrive pas a faire fonctionner postman, à chaque fois erreur de proxy ou objet introuvable? quel sont les paramètres pour que ça fonctionne? est ce que c'est une étape obligatoire?
    merci d'avance.

  • @michelesiano5713
    @michelesiano5713 6 лет назад

    Great!

  • @kshitizagnihotri8777
    @kshitizagnihotri8777 6 лет назад

    Hi I am getting this error
    Can't bind to '{ngModel}' since it isn't a known property of 'ion-input'.

  • @guillaumedu59490
    @guillaumedu59490 6 лет назад

    i got this error
    status: 0, statusText: "Unknown Error", url: null, ok:false, name: "HttpErrorResponse", message: "Http failure response for (unknown url): 0 Unknown Error"
    I guess it's a CORS failure because of the status = 0 but idk how to solve it, any help ?

  • @adamsabdulmajid9543
    @adamsabdulmajid9543 7 лет назад

    great tuts, but I wanna use a different database what changes should make and to what files... thanks

  • @vineetsolidale6562
    @vineetsolidale6562 5 лет назад

    hello sir, you have done a good job, but now the `ionic start --v2 ionic-welcome tabs` command is not working, I tried to follow your tutorials with ionic version 3 and the value is inserting in database properly but it gives an error i.e, "message": "Property 'json' does not exist on type 'Object'.", it is coming from auth-service.ts...
    is there any solution?

  • @arnauddumas1417
    @arnauddumas1417 6 лет назад

    Please how can I use Material design library with my ionic3/angular4 ? Need help

  • @samuelnicolau3542
    @samuelnicolau3542 5 лет назад

    I tried to run your app with ionic serves, and I can not, says it's giving ionic error-app-scripts, could you help me?

  • @ninomory1
    @ninomory1 6 лет назад

    hello friend I have the following problem [ts] The property 'json' does not exist in the type 'Object'. any could you help me

  • @amansuryawanshi856
    @amansuryawanshi856 5 лет назад

    Hello sir, thanks for the superb tutorial but as of now i am having a problem after implementing logout function as you did i get error the time i click on logout button "(getRootNav) is deprecated and will be removed in the next major release" how to fix this issue?

  • @Kako.Michea
    @Kako.Michea 6 лет назад

    Thanks! do you know anyone framework for ASP.NET back-end just like PHP-Slim-Restful?

  • @eliasgalarza100
    @eliasgalarza100 7 лет назад

    Hey, i got this error
    when i push the botton of login in the console show me that "Object { error: Object }" can anyone help me with that..?

  • @harunjantrik
    @harunjantrik 6 лет назад

    i'm having a problem with the signup.ts, the user registration info successfully stored in database BUT it seem that it cannot go to Tabspage, it stuck at the signup page after clicked signup button..

  • @hankicarl
    @hankicarl 7 лет назад

    great tutorial thank you! instead of using the localStorage can I use ionic's event handler (publish/subscribe)?

  • @ddsupportserviceconsultori4538
    @ddsupportserviceconsultori4538 7 лет назад

    very good my friend! do you know how to do the same using rails 5 as API? I don't find nothing talking about with ionic 3... Do you have some link or any idea? i'm trying with "Rack Cors" Gem but i just found with ionic v1.. thanks man.

  • @koripellachaitanya11
    @koripellachaitanya11 7 лет назад

    excellent tutorial..
    can we integrate ccavenue and payumoney with ionic ?
    in the documentation i can find only paypal

  • @johnnycatarong9209
    @johnnycatarong9209 5 лет назад

    I found a solution for the JSON error saying {error: {text: "Enter valid data"}}
    try putting username that is alphanumeric and other attributes in the table are set into VARCHAR in which some inputs must be alphanumeric to be accepted.

  • @jonaserdev
    @jonaserdev 6 лет назад

    hello friend, I find it excellent what you explain here, and thank you for it.
    I have a doubt that I would be grateful if you could solve it ...
    I noticed that when a name is repeated in the database, an error is generated in the registry ... to which this question arises, as it would notify the user if it has already been registered previously and avoid that error but a message onscreen

  • @nndproject6780
    @nndproject6780 6 лет назад +1

    sir how if if user already exists?

  • @prasanthevolutyz7951
    @prasanthevolutyz7951 5 лет назад

    I got this error im using (responded with a status of 415 (Unsupported Media Type))........
    Mr.srinivas can you help me regarding this issue.

  • @aditiarahman435
    @aditiarahman435 6 лет назад

    using latest ionic (ionic 3 and angular 5) need to import HttpClientModule

  • @shqawe
    @shqawe 7 лет назад +3

    i got this error
    Runtime ErrorUnexpected end of JSON input
    and i wrote same code any help?

    • @AyubIdrees
      @AyubIdrees 6 лет назад

      facing same issue .. Have you resolved it yet ?? Need Help

    • @viniciusoliveira2856
      @viniciusoliveira2856 6 лет назад

      here too, can someone help?

    • @komalpatil841
      @komalpatil841 6 лет назад

      hi Ayub Idrees,
      Vinicius Oliveira
      Have both og you got any solution on this same problem ?if yes please help me, i am dealing with same issue

    • @igor9919
      @igor9919 6 лет назад

      1 - go to your index.php in the api folder
      2 - check the signup function: function signup()
      3 - delete or comment the following 'echo' lines:
      echo $email_check.''.$email;
      echo 'here';
      4 - save the index.php
      5 - refresh the app and try again

  • @KoozStunt
    @KoozStunt 6 лет назад

    nice

  • @sourishdutta9600
    @sourishdutta9600 6 лет назад

    How to get this vs code intelligence plugin?!

  • @muaadhanwersalemmedshl9786
    @muaadhanwersalemmedshl9786 3 года назад

    thank you for your help ,, i have problem i used ionic 5 with angular 9 when i want to add the code in signup.ts Page and in authservice.ts Page there is error at postData ... pls help me i have final year project

  • @AstroFiero300
    @AstroFiero300 6 лет назад

    Hi... I have a problen adding property "Authorization: Bearer myToken" into HttpHeaders, when i create "let header = new HttpHeaders();" and i do "header.set('Authorization', Bearer myToken)" (or .append(...) ), I get status=401, statusText: "Unauthorized" and not find property Authorization in header object... But when i create directly on "let header = new HttpHeaders({'Authorization': this.TokenType + ' ' + this.AuthToken})" i get status=0, statusText: "Unknown Error"... Can Anyone help me.

    • @AstroFiero300
      @AstroFiero300 6 лет назад

      I found de solution. I've changed on backend (lumen 5.6) the file "public/index.php", adding two lines:

  • @muhammadamin1388
    @muhammadamin1388 6 лет назад +1

    hi srinivas,
    why my signup button can not working??
    no error massage there and i do as you do

    • @hitenmehta43
      @hitenmehta43 5 лет назад

      I am having the same issue. Did you find a solution?

  • @deadbrainstechnologies6288
    @deadbrainstechnologies6288 4 года назад

    Showing Error in signup.ts file
    Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[AuthServiceProvider -> HttpClient]:
    StaticInjectorError(Platform: core)[AuthServiceProvider -> HttpClient]:
    NullInjectorError: No provider for HttpClient!

  • @iamremilkr
    @iamremilkr 6 лет назад +3

    cross origin request blocked. (Reason : CORS header 'acces-control-allow-origin' missing)
    Sir this is my issue, can you solve thid?

    • @lucianaelisa9501
      @lucianaelisa9501 5 лет назад

      Im with this issue. Did you solve it?

    • @harshmaisheri1894
      @harshmaisheri1894 5 лет назад +1

      Download the cors extension from chrome webstore and it will solve your problem.

    • @nadimnakade
      @nadimnakade 5 лет назад

      If your requesting it from browser than you have to allow cross origin you can enable that using this extension for chrome chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en

    • @nadimnakade
      @nadimnakade 5 лет назад

      @@lucianaelisa9501 If your requesting it from browser than you have to allow cross origin you can enable that using this extension for chrome chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en

  • @ismartlife8838
    @ismartlife8838 6 лет назад +2

    good tutorial....can you please help me in writing the registration and login without Slim framwork. I want to use someother php framework.

  • @komalpatil841
    @komalpatil841 6 лет назад

    Thanks for the video, but at the end while clicking on signup button i am getting following error, please help me resolve it.
    Error:
    SyntaxError: Unexpected token < in JSON at position 0

    • @penulisperasan
      @penulisperasan 6 лет назад

      hi, do you know the solution? I'm also facing this error

  • @jonnathangonzalez4245
    @jonnathangonzalez4245 5 лет назад +1

    Great and very useful tutorial, but I am having a problem in the home.html, when I use the line
    Welcome to {{userDetails.name}} send me this error _co.usersDetails is undefinied.
    I expect someone can help me.

  • @knightsjoker
    @knightsjoker 7 лет назад +1

    help. how to set up the app page for wrong login credential instead of showing: Uncaught (in promise): TypeError: Cannot read property 'user_id' of undefined TypeError. I am trying to set up the error to show on an ion-card but how to stop the page from going to the runtime error page. I use res["_body"];
    never mind. i fixed it :D

  • @cypriendontsa9988
    @cypriendontsa9988 7 лет назад

    Hello tamada and thank you for this series of video.
    It really helps me to take Ionic ionic 3. but I have
    all encountered some problems. I followed this video
    to the letter and the execution was perfect.
    But soon after nothing except this console error when I try to login or register

    • @cypriendontsa9988
      @cypriendontsa9988 7 лет назад

      ?ionicplatform=ios&ionicstatusbarpadding=true&localhost:8100/ionic-lab:1 XMLHttpRequest cannot load localhost/PHP-Slim-Restful/api/login. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8100' is therefore not allowed access. The response had HTTP status code 500.

    • @rendrick_duarte
      @rendrick_duarte 7 лет назад

      Cyprien Dontsa try to active headers_module on wamp

  • @ManishSankari
    @ManishSankari 7 лет назад

    Awesome tutorial but .. im having error says that "Uncaught (in promise): TypeErroe: this.userDetails is undefined HomePage@........ Please Help me !

    • @SrinivasTamada
      @SrinivasTamada  7 лет назад +1

      Clear your browser local storage and try. Go to developer tools -> application -> Clear Site Data

  • @zatuladaniah187
    @zatuladaniah187 5 лет назад

    how to get the api folder ?

  • @ashinaisshin7106
    @ashinaisshin7106 7 лет назад

    please make a tutorial to function checking for login

  • @TheMrGeckow
    @TheMrGeckow 6 лет назад +1

    i followed the instructions like in the video, but if i click the Signup Button nothing happens
    the api works with the postman but not in the app itselve
    anybody can help me?

    • @TheMrGeckow
      @TheMrGeckow 6 лет назад

      in the console i geht the message: Hello AuthServiceProvider Provider
      so i think my authservice works but not the signup function itselfe

    • @hitenmehta43
      @hitenmehta43 5 лет назад

      I am having the same issue. Did you find a solution?

  • @toto33347
    @toto33347 6 лет назад

    How did you manage to make HTML request from web browser ?

    • @mailmerohit5
      @mailmerohit5 5 лет назад

      Just BCOZ of nodeJS .. happy codeing :)

  • @techtalk1652
    @techtalk1652 7 лет назад

    Is this app available on playstore?

  • @chiennguyen6897
    @chiennguyen6897 7 лет назад

    My Slim api not run, error $app-> run row 12, file index.php?? Please help me

    • @SrinivasTamada
      @SrinivasTamada  7 лет назад

      Cross verify your require 'Slim/Slim.php'; file path

  • @SunilRathod-kl9fe
    @SunilRathod-kl9fe 6 лет назад

    Sir api not working in my wamp server please help me

  • @denyardya298
    @denyardya298 5 лет назад

    please upload tutorial for menu session users from ionic

  • @lamroussiadly1266
    @lamroussiadly1266 7 лет назад +1

    I have an error when I used postman, 500 Internal Server Error. Can you help me?

    • @SrinivasTamada
      @SrinivasTamada  7 лет назад

      Enable mod_rewrite extension for PHP, this will helps you to run the .htaccess file for friendly URL APIs

    • @guyalexistambie7577
      @guyalexistambie7577 6 лет назад

      The extension is activate but i still have 500 Internale Server Error.

    • @mariamcheikh540
      @mariamcheikh540 6 лет назад

      click on your wamp icon -> apache -> httpd.conf -> and then remove the # before LoadModule headers_module modules/mod_headers.so

    • @Lina-kx8mv
      @Lina-kx8mv 5 лет назад

      @@mariamcheikh540 still shows error! do you have a solution?

  • @13mycL8
    @13mycL8 7 лет назад

    thanks for this video but I have a question. How to transfer from another database? It has an error when I change the db name

    • @13mycL8
      @13mycL8 7 лет назад

      maybe this is because of the clone in github?how to fix this?

    • @SrinivasTamada
      @SrinivasTamada  7 лет назад

      Enable your localhost URL in src/providers/auth-service.ts
      let apiUrl = "localhost/PHP-Slim-Restful/api/";
      //let apiUrl = 'api.thewallscript.com/restful/';

    • @13mycL8
      @13mycL8 7 лет назад

      I already enable it but still error
      let apiUrl = 'localhost/PHP-Slim-Restful/api/';

    • @SrinivasTamada
      @SrinivasTamada  7 лет назад

      Configure your PHP API project with your local database.

    • @13mycL8
      @13mycL8 7 лет назад

      and now its totally not running :( , the app is totally broken

  • @marwansalem76
    @marwansalem76 7 лет назад

    when i post through POSTMAN to my localhost:82/api/signup I got this error : {"error":{"text":SQLSTATE[HY000] [2006] MySQL server has gone away}}
    What can I do ?
    Please Help!

  • @nkzalex8452
    @nkzalex8452 6 лет назад

    Hey, i have this issue
    Uncaught (in promise) : [object Object]

  • @craftsoftwaresystem636
    @craftsoftwaresystem636 7 лет назад

    can u help me convert my php mysql ecommerce website to ionic 3 app or can you update ionic 1 app with mysql database backend to ionic 3 ..waiting for your response

  • @TestTest-xe7vy
    @TestTest-xe7vy 6 лет назад

    help please :
    POST localhost/PHP-Slim-Restful-master/api/signup 500 (Internal Server Error)
    Failed to load localhost/PHP-Slim-Restful-master/api/signup: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:8100' is therefore not allowed access. The response had HTTP status code 500.

    • @TestTest-xe7vy
      @TestTest-xe7vy 6 лет назад

      with postman :
      Internal Server Error
      The server encountered an internal error or misconfiguration and was unable to complete your request.
      Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
      More information about this error may be available in the server error log.
      Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80
      help me !!!!!!

  • @kaylrabanzo8425
    @kaylrabanzo8425 6 лет назад

    {error: {text: "Enter valid data"}}
    error
    :
    {text: "Enter valid data"}
    text
    :
    "Enter valid data"
    i got this error from XHR please help :

  • @mapsa1
    @mapsa1 7 лет назад

    Great tutorial man.
    I get this error:
    404 Page Not Found
    The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.
    Could it be firewall?

    • @mapsa1
      @mapsa1 7 лет назад

      sorted. localhost:/PHP-Slim-Restful/api/signup

    • @AnkitkumarChheda
      @AnkitkumarChheda 7 лет назад

      if you directly try to run api.php then this will happen.. its a PHP SLIM thing.

  • @GabrielRamos-rz4bj
    @GabrielRamos-rz4bj 7 лет назад

    Hey man, please make a tutorial to receiver data from firebase in ionic 3
    please, please, please???

    • @AnkitkumarChheda
      @AnkitkumarChheda 7 лет назад +1

      Can you rely for production level app on firebase? Learning PHP API is always better,

  • @DanielWeikert
    @DanielWeikert 7 лет назад

    can you share the php file?

    • @chiennguyen6897
      @chiennguyen6897 7 лет назад +1

      php file into $git clone github.com/srinivastamada/PHP-Slim-Restful.git

    • @DanielWeikert
      @DanielWeikert 7 лет назад

      can you explain me how to use the api? Do i have to save it somewhere in htdocs in the xaamp folder?

  • @huyho7310
    @huyho7310 6 лет назад

    I make GET request successful but POST i get errror: OPTIONS localhost/hoofapi/api/login 404 (Not Found)

  • @rebarius
    @rebarius 7 лет назад

    Thanks you helped me a lot :)! But i realized to the end of the Tutorial, that I just have to add 2 Lines to my existing App and the User stays logged in :D. Just localStorage.getItem and setItem! Great!

  • @rendrick_duarte
    @rendrick_duarte 7 лет назад

    Anyone is getting nothing in -> token?

    • @komalpatil841
      @komalpatil841 6 лет назад

      yes, i an dealing with same problem. have you got any solution ?

    • @igor9919
      @igor9919 6 лет назад

      1 - go to your index.php in the api folder
      2 - check the signup function: function signup()
      3 - delete or comment the following 'echo' lines:
      echo $email_check.''.$email;
      echo 'here';
      4 - save the index.php
      5 - refresh the app and try again