How to structure authenticated app?

You must Login before you can answer or comment on any questions.

I have been working for a while on an app that uses createHTTPClient in a lot of different places to hit my API. Now, I have enabled authentication for a lot of my API services. As expected, I am receiving

{error:"access denied"}
Is there a global hook where I can check for access_denied and move the user to the login screen? Should I wrap HTTPClient and centralize this check myself? How would you recommend I structure an app for authentication?

1 Answer

Hi

Have you seen the new additions to the httpClient that are in Ti SDK 3.0.0 GA?

If you have set up authentication then these should help you out.

— answered 1 year ago by Malcolm Hollingsworth
answer permalink
2 Comments
  • Those docs are pretty light. How can I find out what type of authentication that is related to / how the credentials are persisted / etc? Also, is there a way to see / clear the cookies that my server is using for this? It looks like headers are getting stripped out of my responses.

    — commented 1 year ago by Joseph Beuckman

    • On iOS this will enable NTLM authentication
    • For Android, custom AuthSchemeFactory

    You can find more here in the ticket.

    https://github.com/appcelerator/titanium_mobile/pull/3458

    You are going to need to provide some code to work out why you are losing things.

    — commented 1 year ago by Malcolm Hollingsworth

Your Answer

Think you can help? Login to answer this question!