aerogear security and android
by marceloheck
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.
10 years, 9 months
AeroGear.js without jQuery Discussion
by Lucas Holmquist
> I agree that it would be nice to implement AGJS-70 (Investigate removing jQuery requirement). Meanwhile, there is an open source project on GitHub that claims to offer a custom builder for jQuery in order to include only the modules needed [1] [2]. I haven't tried it yet but maybe we could create a custom jQuery build which includes only the parts currently needed in AeroGear. This would mean a smaller size of the jQuery dependency.
The AG lib depends on a few parts of jQuery, the biggest being jQuery.Ajax and the promise implementation.
i know we can make custom builds of jQuery pretty easily( building from source ), but i don't really want to bundle it within our lib.
and i don't think with bower we can do this easily. although they did just add a post install hook, so perhaps that could be something to look at.
Datamanager only uses the promise implementation of jQuery( and some random thing for the filter method, which could probably be updated ). Promises are starting to become available natively in browsers and jQuery doesn't use the Promise/A+ spec, so it could be harder to fallback without a shim of some kind
while i don't really want to reinvent the wheel in terms of Ajax, it might be interesting to take a look. I think in a previous ML thread about what 2.0 looked like, that Pipeline would maybe just be a JSON only thing, with exception for multipart
10 years, 9 months
Modularization and Push
by Summers Pittman
Y'all,
So there has been some concerns with the complexity of the build
especially where including the Google GCM (push) libraries are
concerned. Additionally there have been some requests for a separate
"push" module which won't need the full aerogear android library.
The full modularization of the library along with several other
improvements is scheduled for the "2.0" epic.
So my question is a) Should we make a 2.0 which is only the
modularization sooner and iterate on that a few times before we include
our improvements in a 3.0 or b) Should we create a "fork" project which
is only a push module? This new project will get merged back into the
main project when we have our complete modularizations.
--
Summers Pittman
>>Phone:404 941 4698
>>Java is my crack.
10 years, 9 months
Cordova and iOS
by Miguel Lemos
Hi all!
As you know I managed - with a little help from my friends ;-) -to have
the push notifications working on Android. But with iOS, not the same luck
so far. What I've done:
a) I created my development profile at Apple;
b) I uploaded the Certificates.p12 to the AeroGear Server;
c) I installed the devprof profile (the mobile provision file) in Xcode
(which says it's valid);
d) I inserted the variant ID and Secret on my phone code, like this (keys
are not real):
if(device.platform=='iOS'){
varID= "bb66d681-zabc-42cc-87f6-c27185c2389f";
varSec= "e66271f5-dd92-492d-bbac-83736f53e930";
} else if (device.platform=='Android'){
varID= "b438d657-5eef-4301-ba82-28c46cc3466f";
varSec= "150b5f99-z450-4edc-bdad-62dad284af2e";
}
var pushConfig = {
senderID: "278695547260", // not relevant for Android anyway
pushServerURL: "https://aerogear-metalpush.rhcloud.com",
variantID: varID,
variantSecret: varSec,
alias: userid
}
But nevertheless I can't register the device. I get this error:
no valid aps-environment (the message is not in English, so I translate it
freely:"It was not found a valid aps-environment for the app")
What can be wrong?
Thanks
Miguel
10 years, 9 months
aerogear.org revamp: team work
by Corinne Krych
Hello All,
With aerogear web site roadmap [1] proposal we can start working together toward a new website. We already have a common branch (named sass - maybe not the best name) [2] where we can work together. It’s important to rebase/keep this branch up to date.
Here is how we could work together efficiently:
- take JIRA for 0.1.0 release,
- branch from sass branch, do you work
- send PR againt sass.
- usual PR review
- then PR can be merged into sass.
If a ticket requires changes in page documentation like splitting a markdown page into several pages or move to asciidoc format etc… we should do this JIRA initial in master branch, send a PRL, get the PR merged and get the changes in sass branch. This way we can keep history and let the documentation evolves without fear for merging it into new site revamp branch.
Thought? #agreed?
++
Corinne
[1] http://aerogear.org/docs/planning/roadmaps/AeroGearWebSite/
[2 https://github.com/aerogear/aerogear.org/tree/sass
10 years, 9 months
UPS Console US/Tech updates
by Jay Balunas
Hi All,
After talking with Thomas about how liveoak has been working I think their approach to tracking there work there is a good approach. Take a look at these jira's for an example.
https://issues.jboss.org/browse/LIVEOAK-91
https://issues.jboss.org/browse/LIVEOAK-80
Is this something we could do for our upcoming console and tech migration efforts? This will also make it a lot easier for us to judge where we are, and what work is left. Especially when we have assistance from others (such as some on the LiveOak team).
Another area that Thomas and I talked about was the UX/HTML/CSS reviews and reuse. The updated mockups from Hylke [1] are obviously quite similar to LiveOak's console. There should be quite a bit of overlap with core HTML and CSS that should make it easier for Hylke to produce what we need. Any help that Gabriel will be able to assist, advise, and review which should help a lot.
Thoughts?
Thanks,
-Jay
[1] https://github.com/hbons/aerogear-design/blob/master/ups-new-ux/applicati...
10 years, 9 months
AeroGear iOS 1.5
by Corinne Krych
Hello iOS Friends,
AeroGear iOS 1.5 is on his way. We plan (if no objections raised) to release it end of this week. Main focus of 1.5 is to upgrade to iOS7 and AFNetworking 2.x (latest 2.2.1).
To test it, open Podfile and point to the latest git branch
pod 'AeroGear', :git => 'https://github.com/aerogear/aerogear-ios.git'
Help us make this release a success, give it a trial, and let us know how it goes for your project.
++
Corinne
10 years, 9 months