Joel de Matos

Greenhorn
+ Follow
since Nov 10, 2003
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joel de Matos

Thank you all for your help, i will try a couple of solutions and then i hope i can show you better what the problem is, and hopefully a solution... I am still new to jaas so there are a few concepts that are new too me.

Thanks!
16 years ago
Thank you for you answer, i will try to explain better:

I have a jboss server with many EJB services (E1, E2, ..., En) and to connect to that jboss server i need to use JAAS.

I have a client application that is not a web application.

The client application needs to call different EJBs with different logins at different stages (modules) of a client transaction.

That being told, at stage 1 the client application calls service E1 with authentication A1, new InitialContext, new LoginContext.
Context context = new InitialContext(properties);
LoginContext lc = new LoginContext("serverLogin", new NeoCallbackHandler(username1, password1));
lc.login();

Later in transaction, the client application needs to call service E2 with authentication A2, once again, new InitialContext, new LoginContext.Context context = new InitialContext(properties);
LoginContext lc = new LoginContext("serverLogin", new NeoCallbackHandler(username2, password2));
lc.login();

Since the client is processing many transactions, when it calls service E1 again, the authentication A1 has been replaced by A2, so when E1 is called again by the client, the login context is from A2.

This is all in the same thread.

I think there is a problem with JAAS where a VM can hold only 1 login context so i need to know if i can cache the login contexts and switch between them instead of creating a new login context for every call.

Thank you for your patience
[ April 15, 2008: Message edited by: Joel de Matos ]
16 years ago
Hello friends,

I have an application connecting to a jboss server and i am using JAAS.
This application has a couple of modules and each of them should have different authentication (usernames) to access different services in the same jboss server.

The problem is that when module A authenticates with server it is ok, then later in the thread lifecycle, module B authenticates with server, that is ok too. But even later when module A calls jboss server for second time, it is using the authentication used by module B.

I don't want to do authentication for every call, so is there a way for me to know if a thread has a successfull authentication? And is it possible to change it? like having a cache of login contexts or something...

Thank you for your patience and sorry for the bad english
16 years ago

Originally posted by Nitesh Kant:
Hi Joel,
Please do not hijack a thread for a different question(DontHijack)
This thread was to discuss the new journal article.
Request you to post this question as a new thread in the Security forum.



Will do, very sorry for the inconvenience!
Anyways, thanks to Rahul for the article.
cheers
16 years ago
Hello friends,
I have an application connecting to a jboss server and i am using JAAS.
This application has a couple of modules and each of them should have different authentication (usernames) to access different services in the same jboss server.

The problem is that when module A authenticates with server it is ok, then later in the thread lifecycle, module B authenticates with server, that is ok too. But even later when module A calls jboss server for second time, it is using the authentication used by module B.

I don't want to do authentication for every call, so is there a way for me to know if a thread has a successfull authentication? And is it possible to change it? like having a cache of login contexts or something...

Thank you for your patience and sorry for the bad english
16 years ago
I will try that.
Thanks for your help Ernest!
19 years ago
Thank you so mutch for you quick answer, but my problem is switching between 2 running apps (My swing app and a powerpoint presentation) not launching the ppt. I can exec() the "tasklist" command and parse the result to get the pid of the presentation, but how do i change the focus to it?
Thanks
19 years ago
Hi there, i am currently developing a swing app for a presentation.
This presentation will have the cliend and a powerpoint presentation running at the same time.
The thing is how do i switch from my app to ppt? Using ALT TAB is NOT an option so i want to associate that functionality to a button that when pressed it wil load the PPT.
I have looked for this everywhere but i found nothing
Thanks in advance.

Best regards,
Joel
19 years ago
Hello guys, i really need your help with a problem here...
I have a normal JComboBox with 3 items, but what i want is all the items to be disabled. If not possible, than only the default value may be enabled, but the other choices must be disabled (grayed out and not chooseable).
I need this because the user of my app must see all the possible values for a question, but he will be forced to use the default (and correct) one.
can you help? it is very important
thanks
21 years ago
Can't use JDialog... Doesn't have a maximize button :roll:
It really has to be a JFrame.
Thanks anyway
21 years ago
Hello, i've searched for this in the forum but i didn't find anything usefull.
What i want is to make a JFrame to be always on top but not stealing the focus.
Scenario: I have a maximized app and i have a smaller jframe on top. When i click in the "main" application i want my JFrame to be on top of it but without stealing the focus from the application.
I have this code:

Can you help me?
Thanks!
[ November 20, 2003: Message edited by: Joel de Matos ]
21 years ago
Well i did it with dynamic resize (it would be so much better...) but, as we say in Portugal (and other places too), "The customer is always right".
This simple code shows it:

Now seriously, on the scrollables point, the user wants to maximize the window so he doesn't have to resize it for the cases that the information gets bigger than the window, but still fits on the screen.
If the information gets wider than the screen, he will scroll through it.
The modal feature is not so important because despite my class constructor has a boolean argument to decide if the window will be or not modal, it is always invoked with modal = false (i think that the guy who made the original class just put it there for some future development, and in that case, i really won't bother myself too much with it), so i'll just set my frame to be always on top with this code: (Is it good?)

Thanks for all your support!
I really appreciate your help as i always learn something more with your replys!
21 years ago
Well, i really have to implement the maximize button in JDialog.
There is a possibility of changing the JDialog IF AND ONLY IF i can ensure that the new window will have the same behaviour.
This is what i have:
A JDialog with a button, two scrollables inside and some other non-editable text boxes.
The data in both scrollables can get bigger than the window if the button is pressed (the button makes new data to appear in both scrollables).
After some discution it was decided that a maximize button must be provided with the window. I can change what i want BUT the window must keep its behaviour.
So my question here becomes a little different:
What is the best way to implement a JDialog with a maximize button?
Build a JFrame and setting it to modal?
I am no expert in swing so i hope you can help me.
Thanks
21 years ago

If there are any custom components or scrollpanes you might have to make sure they are returning an appropriate preferred size or the dialog will size itself smaller than it needs to be.


Unfortunatly this is what is happening.
I tried to pack it but the window gets smaller
I am using this constructor:
Dialog(Frame owner, String title, boolean modal)
Should i try to get the size of my components and then resize the window "manualy" or is there a way to get the window to get the size of those components?
Thanks so much for your help!
21 years ago
I am currently responsible for some error-fix tasks on a large project, so i can't just change things for every problem that i have to fix.
This would explain why i can't change from a JDialog to a JFrame, as the behaviour of a JDialog is expected.
My JDialog has a button inside that shows a little more info that is hidden by default. The thing is when i press that button, my JDialog always needs to be resized for everything to fit inside, so i have to put a maximize button there as the need to always resize the window is unacceptable for the client.
Maybe some different kind of window would be a lot better to implement this feature but, like i said, this is a big project with a lot of dependencies and i can't just change things around to make my life easier...
I hope i was clear, my english is not very good :roll:
Thanks a lot!
21 years ago