1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default Answered: ExtJs and XML schema

    Answered: ExtJs and XML schema


    Hello
    In need of help again.
    Well I wanted to write a authentication mechanism using ext-js and xml schema.
    That is I will have a few users in an xml schema,with username and password
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <message success="true">
    <contact>
        <username>Admin</username>
        <password>Some encrypted password</password>
        .
        .(other fields)
        
    </contact>
    </message>
    What I want to implement is:
    1) Have a form to add a user,which on adding saves the username and password(encrypted) to the xml files.
    Encryption can be using standard base64 encoding using java.
    2) use the same username password to authenticate the user.i.e if the username password matches he is allowed to enter the application else not.How to check if the username posted from form matches the one in the xml file.


    Problem I am facing:
    I am able to read from xml files(referred to sample examples) but how to save them to the xml? Is it possible
    Can you point to some examples??

    Any help would be appreciated.

    Regards
    Sachin

  2. Theoretically it is possible to build the XML in ExtJS using an XML writer. However, I don't think that's the correct way to do what you're trying to do.

    Writing the XML files to disk will obviously need to happen on the server. The only secure way to create the files is for them to be created on the server. If you build them in the client then you'd need to do some complex checks on the server-side to validate them, it isn't worth it.

    Instead just pass the fields to the server as request parameters and build the XML files there.

  3. #2
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    Unless I've misunderstood, this is not an ExtJS question.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    Hello skirtle
    Why it isn't??Can't we do this in extjs??A login mechanism where user is authenticated.
    I have a form in extjs,which will be posting values.I need to read the xml records and check if its der.
    Yes->Success No->Invalid.
    But,i have to add records to the Xml first using a kind of register form and save those to the xml.(in short write to xml)
    I have a DB to store it but it holds critical data and I cannot tweak in tables for this in it now.
    So as a work around i want xml files with encrypted pwd to hold the data for me.i am not sure encryption can be done using extjs,if yes please point me to some links or examples.

    i hope i got it right and clear this time.

    Regards
    Sachin

  5. #4
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    I'm afraid this makes no sense to me at all. Almost everything you're describing (creating XML files, authenticating users) needs to be done on the server.

    From an ExtJS perspective it's just a couple of form fields and an Ajax request. Your question implied that this wasn't the bit you were struggling with.

    These two lines are particularly worrying:

    Encryption can be using standard base64 encoding using java.
    i am not sure encryption can be done using extjs
    The first implies that you think base64 is a form of encryption, it isn't. The second implies that you're attempting the authentication on the client, which offers no security whatsoever.

  6. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default ExtJs and XML schema

    ExtJs and XML schema


    @skirtle
    I was wrong there it has to be encoding and decoding using base64.Doing it as I am not using a strong database.Encryptions has to be MD5 or SHA .But thats a later part.

    At first I would only like to know how can I write records to XML files as we use either json or xml in extjs.I did not find an example to add/edit records and save them to xml files.

    Regards
    Sachin

  7. #6
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    Theoretically it is possible to build the XML in ExtJS using an XML writer. However, I don't think that's the correct way to do what you're trying to do.

    Writing the XML files to disk will obviously need to happen on the server. The only secure way to create the files is for them to be created on the server. If you build them in the client then you'd need to do some complex checks on the server-side to validate them, it isn't worth it.

    Instead just pass the fields to the server as request parameters and build the XML files there.

  8. #7
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    @skirtle
    Thanks for the inputs.What I understand by your comments is,I should get the form values by doing
    Code:
         request.getParameter('username');
    save it on the server itself in xml files.And then use them for authentication.
    Am I right?
    If not please correct

    Regards
    Sachin

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar