Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
|
Name | Default Value | Required | Description |
|---|---|---|---|
| | false | A client name with recommended (but not required) format |
| | true (can alternatively be set via | Login username (an email address). |
| | true (can alternatively be set via | Login password. |
| | false | If set to |
| | false | If set to |
Message headers
Name | Type | Message | Description |
|---|---|---|---|
| | in | Overrides the hostname defined in the endpoint URI. |
| | in | Overrides the |
| | in | Overrides the |
| | out | Contains the authentication token obtained from Google Accounts. Login to a development server does not set this header. |
| | out | Contains the application-specific authorization cookie obtained from Google App Engine (or a development server). |
Message body
The glogin component doesn't read or write message bodies.
Usage
The following JUnit test show an example how to login to a development server as well as to a deployed GAE application located at http://camelcloud.appspot.com.
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.apache.camel.component.gae.login.GLoginBinding.*;
import static org.junit.Assert.*;
public class GLoginTest {
private ProducerTemplate template = ...
@Test
public void testDevLogin() {
Exchange result = template.request("glogin://localhost:8888?userName=test@example.org&devMode=true", null);
assertNotNull(result.getOut().getHeader(GLOGIN_COOKIE));
}
@Test
public void testRemoteLogin() {
Exchange result = template.request("glogin://camelcloud.appspot.com", new Processor() {
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader(GLOGIN_USER_NAME, "replaceme@gmail.com");
exchange.getIn().setHeader(GLOGIN_PASSWORD, "replaceme");
}
});
assertNotNull(result.getOut().getHeader(GLOGIN_COOKIE));
}
}
The resulting authorization cookie from login to a development server looks like
ahlogincookie=test@example.org:false:11223191102230730701;Path=/
The resulting authorization cookie from login to a deployed GAE application looks (shortened) like
ACSID=AJKiYcE...XxhH9P_jR_V3; expires=Sun, 07-Feb-2010 15:14:51 GMT; path=/
Dependencies
Maven users will need to add the following dependency to their pom.xml.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-gae</artifactId>
<version>x.x.x</version>
</dependency>
