Hello
I search a sample with aerogear and security server
in client
private AuthenticationModule authModule;
private String baseURL = "http://localhost:8080/servicos/service/auth";
private TextView status;
private Button login;
private Button logout;
private static final String LOG_TAG = login.class.getName();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Authenticator authenticator = new Authenticator(baseURL);
AuthenticationConfig authenticationConfig = new
AuthenticationConfig();
// authenticationConfig.setAuthType(AuthTypes.HTTP_BASIC);
authenticationConfig.setLoginEndpoint("/login");
authenticationConfig.setLogoutEndpoint("/logout");
authModule = authenticator.auth("login", authenticationConfig);
status = (TextView) findViewById(R.id.editText1);
login = (Button) findViewById(R.id.button1);
logout = (Button) findViewById(R.id.Button01);
button = (Button) findViewById(R.id.button1);
/* // Capture button clicks
button.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this,
login.class);
startActivity(myIntent);
}
});*/
login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
authModule.login("nome", "senha", new
AbstractActivityCallback<HeaderAndBody>() {
@Override
public void onSuccess(HeaderAndBody data) {
Log.d(LOG_TAG, "Received ID: " + data.toString() );
logged(true);
// Start NewActivity.class
Intent myIntent = new Intent(MainActivity.this,
br.gov.pr.dc.sisdc.activities.MapActivity.class);
startActivity(myIntent);
// Toast.makeText(getActivity(), "logado",
Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Exception e) {
displayError(e.getMessage());
// Toast.makeText(getActivity(), "erro",
Toast.LENGTH_SHORT).show();
Log.d(LOG_TAG, "error: " + e );
Intent myIntent = new Intent(MainActivity.this,
br.gov.pr.dc.sisdc.activities.MapActivity.class);
startActivity(myIntent);
}
});
}
});
is ok
but how to use the rest in android is authenticate and authorize cripty
token push etc... in other REST service?
is session? is value how?
...
URL BASE_URL = new URL("http://localhost:8080/servicos/service/");
PageConfig pageConfig = new PageConfig();
pageConfig.setLimitValue(5);
pageConfig.setMetadataLocation(PageConfig.MetadataLocations.WEB_LINKING);
PipeConfig pipeConfig = new PipeConfig(BASE_URL, AbrigoVO.class);
pipeConfig.setEndpoint("pessoa");
pipeConfig.setPageConfig(pageConfig);
pipeline = new Pipeline(BASE_URL);
pipeline.pipe(pessoaVO.class, pipeConfig);
LoaderPipe<pessoaVO> pipes = pipeline.get("pessoavo", mContext);
//LoaderPipe<pessoaVO> pipes = this.pipeline.get("pessoavo", fragment,
mContext);
//TODO
https://github.com/aerogear/aerogear-aerodoc-android/blob/master/src/org/...
pipes.read(readCallback);
Log.d(LOG_TAG, "Received ID: " );
return null;
} catch (Exception e) {
// TODO Need error handling
Log.e(LOG_TAG, e.getLocalizedMessage(), e);
Log.e(LOG_TAG, "sem serviço", e);
e.printStackTrace();
return null;
}
...
and security server jboss 7 ??
@Path("/pessoa/")
public interface pessoaResource {
@Produces(MediaType.APPLICATION_JSON)
public Response listar();
@GET
@Path("/{codigo}")
@Produces(MediaType.APPLICATION_JSON)
public Response obter(@PathParam("codigo") Long idpessoa);
}
i add
@Inject
private IdentityManagement configuration;
@Inject
private AuthenticationManager authenticationManager;
and
<interceptors>
<class>org.jboss.aerogear.security.interceptor.SecurityInterceptor</class>
</interceptors>
and
@Secure("admin")
but error injection
WELD-001408 Unsatisfied dependencies for type [EntityManager] with
qualifiers [@Default] at injection point [[field] @Inject private
org.jboss.aerogear.security.shiro.authz.GrantConfiguration.entityManager]
examples JaxRS and shiro and demo not funcional of soluction server and
client android
i connect database login password e groups for login
how to keep the connected User? have database or saved in the session?
can someone give me a practical example for using rest client server?
--
View this message in context:
http://aerogear-dev.1069024.n5.nabble.com/aerogear-security-and-android-t...
Sent from the aerogear-dev mailing list archive at
Nabble.com.