Project

General

Profile

How to implement non form based logins?

Added by Alexander Theißen about 10 years ago

In addition to my web app I am developing an REST API using WResource for an smartphone app. For the web app I can use the AuthWidget to login. For the API I need http basic. As far as I see that is not implemented at the moment, right?

Since http basic is pretty easy I just read the username and password from the Wt::Http::Request object. What I don't know is: How do I talk the the Auth System when not using the Widgets supplied by wt?

For example how do I register a new user? When I call registerNew on the Auth::Dbo::UserDatabase< myUser > I get Auth::User and not myUser. I am lost. Is there no document covering the case that I don't want to use the supplied widgets?


Replies (2)

RE: How to implement non form based logins? - Added by Wim Dumon about 10 years ago

Hello,

The blog example demonstrates how a user can be added through the API. Search for how the admin user is added if it does not yet exist, in model/BlogSession.C.

BR,

Wim.

RE: How to implement non form based logins? - Added by Alexander Theißen about 10 years ago

Thanks. I think I can work with this.

    (1-2/2)