Results 1 to 5 of 5

Thread: Delphi RAD Server User Authentication Example

  1. #1
    Sencha Premium User
    Join Date
    Nov 2018
    Posts
    3

    Default Delphi RAD Server User Authentication Example

    How do I configure the Ext.Ajax.request url to handle:

    POST http://localhost:8080/users/login HTTP/1.1
    {"username":"User1","password":"User1pass"}

  2. #2
    Sencha User
    Join Date
    Oct 2018
    Location
    Noida
    Posts
    58
    Answers
    10

    Default

    If your server is working on that port 8080, possibly Ext.Ajax.request method will not have any problem to send request on that url that you gave. Not sure what is the exact problem you are facing.

  3. #3
    Sencha Premium User
    Join Date
    Nov 2018
    Posts
    3

    Default

    It get the following error when client web app tries to authenticate user from Delphi RAD Server: Unauthorized Request

    Here is my code:

    Ext.Ajax.request({
    url: 'http://localhost:8080/users/login',
    params: {"username":"User1","password":"Password1"},
    success: successCallback,
    failure: failureCallback
    });

    Am I missing header details?

  4. #4
    Sencha User
    Join Date
    Oct 2018
    Location
    Noida
    Posts
    58
    Answers
    10

    Default

    Your request seems fine like given in Sencha docs - https://docs.sencha.com/extjs/6.5.2/...method-request

    Generally it should work, can you try to change your url from "http://localhost:8080/users/login" to "/users/login", just for try. As request method will add domain to the url by itself so no need to mention http://localhost:8080 explicitly. Also are you sure that your application is working on localhost:8080 port number ?

  5. #5
    Sencha Premium User
    Join Date
    Nov 2018
    Posts
    3

    Default

    I was able to make it work using the jsonData property:

    Ext.Ajax.request({
    url: 'http://localhost:8080/users/login',
    method: 'POST',
    jsonData: {
    "username": "User1",
    "password": "Password1",
    },
    headers: {'Content-Type': 'application/json'},
    success: successCallback,
    failure: failureCallback
    });

Similar Threads

  1. what is the best way to implement an user authentication?
    By ataker98 in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 20 Aug 2012, 3:44 AM
  2. User Authentication
    By kulshreshtha.s in forum Ext Designer: Help & Discussion
    Replies: 3
    Last Post: 4 Oct 2011, 8:14 AM
  3. User Authentication
    By kgrigor in forum Ext: Discussion
    Replies: 3
    Last Post: 1 Jul 2011, 3:11 AM
  4. Replies: 3
    Last Post: 4 Jun 2010, 3:15 AM
  5. User authentication question
    By scooter in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 4 Mar 2010, 8:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •