lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer" <simon.willna...@googlemail.com>
Subject Re: gdata-server newbie installation/code question
Date Mon, 11 Sep 2006 10:59:43 GMT
On 9/10/06, Peter Decrem <thegallier@gmail.com> wrote:
> I was able to create the war gdata-server file with simon's documentation.
> The documentation now states I should create user accounts.  Does the
> section below (authenticate an existing account) also need to be included
> (in the section Create/update/delete an account) ?
Yes and No, This is still a bit difficult and I'm not happy with the
administration interface. So If you want to create your own account
you need to authenticate with the predefined admin account. The
authentication returns a String token which is your authtoken. with
this auth token you can create a new user.

 Is the
> yourAuthenticationstring the same as authToken in the code directly below
> this?  Should I assume that GoogleLogin really means gdata-server login ?
Yes it is. GoogleLogin is just the name of the parameter the
application looks for to authenticate the user. This will be
configurable in the future. Currently this is as described in the
gdata protocol definition as GoogleLogin.

best regards Simon
>
> Thanks
>
> ___
>  Authenticate an existing account
>
> Requiered jars:
>
>    -
>
>    gdata-client.jar
>
> ____
>
>  /*
>   * The protocol can either be http or https, depends on your server
> configuration.
>   * The name of the application is just a meta data field an can be ommited.
>   */
>   GoogleService service = new
> GoogleService("feedId","yourapplicationname", "http",
> "localdomain:port/gdata-server");
>  /*
>   * ServiceType should be configured in the gdata-config.xml
>   * Username and password for the admin account are the default values
>   * and should be changed
>   */
>   String authToken = service.getAuthToken("administrator","password",
> null,null,"servicetype","yourapplicationname");
>
> ____
>
> Create/update/delete an account
>
> ____
>
>  String accountAdminEndpoint =
> "http://www.yourdomain.com/gdata-server/admin/account";
>   /*
>    * XML Account format to send in the http request body
>    */
>   String account = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
>   "<account>" +
>     "<account-name>administrator</account-name>" +
>     "<password>yourpassword</password>" +
>     "<account-role>15</account-role>" +
>     "<account-owner>" +
>       "<name>your name</name>" +
>       "<email-address>admin@apache.org</email-address>" +
>       "<url>http://www.apache.org</url>" +
>     "</account-owner>" +
>     "</account>";
>
>   RequestEntity feedReqeustEnt = new StringRequestEntity(account);
>   /*
>    * Put method to update the account
>    */
>   PutMethod httpMethod = new PutMethod(accountAdminEndpoint);
>   /*
>    * you need to authenticate before adding a new feed. Authentication
>    * will return an authentication token.
>    */
>   httpMethod.addRequestHeader(new Header("Authorization",
>   "GoogleLogin auth=yourAuthenticationstring"));
>   httpMethod.setRequestEntity(feedReqeustEnt);
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message