hawkular / hawkular-android-client

Apache License 2.0
10 stars 26 forks source link

Provide Auth system for using key secret pair #50

Closed openwarrior closed 8 years ago

openwarrior commented 8 years ago

At present this client use Access Tokens which restrict use of secret store. To be able to use secret store by providing minimum changes AuthzModule is Implemented. It performs all related work of generating new key and secret pair, Storing them as account, retrieving stored account, deleting stored account.

ModifiedAuthzModule - Implement AuthzModule from Aerogear Authz By this rest of connectivity remain same.

ModuleKeeper - Retain Modified AuthzModule in a Map in the imitation of AuthorizationManager

openwarrior commented 8 years ago

@ming13 @pilhuhn @jpkrohling @danielpassos Can you please review again. Applied approx everything except Thread coz wanted to leave more like cookbook code of aerogear. And I don't know if line redundancy is upto the standard or not but i tried.

openwarrior commented 8 years ago

@ming13 please don't make me dance. :smile: I really got fond of you.

openwarrior commented 8 years ago

@danielpassos Please review the code

openwarrior commented 8 years ago

@ming13 @pilhuhn @jpkrohling If code look satisfactory please accept the pull request so that I can move ahead with more contribution.

Generic Exceptions are removed.

pilhuhn commented 8 years ago

A question and a comment - otherwise LGTM :+1:

danielpassos commented 8 years ago

Hey guys, I'd like to review that before merge. Please, give me some time. I'll try do it tomorrow morning

openwarrior commented 8 years ago

@pilhuhn Changed from AsyncTask To background Thread in thought of improvement. Please take a look to check its not got messed up.

danielpassos commented 8 years ago

Hey @anuj1708

First of all, sorry about my delay in review this. I have some question about this PR:

  1. Why we need that? The app works without it?
  2. What is the different between it and HttpBasicAuthenticationModule?
  3. You have created a new AuthzModule, but I can not see where it is/will be used
openwarrior commented 8 years ago

@danielpassos
No problem :)

1.1 We need at present to shift from connecting to Key Cloak for Access Token to using Secret Store (provide key secret pair in response of a POST request). -- Even if we retain using access token still for new feature (QR for key/secret). Which have been added to Hawkular and to be added to android client. 1.2 At present app works without it. but not including this is limiting the functions

2 . Diff from HttpBasicAuthenticationModule Cause its more about retaining the key secret pair for long time. and that too we never always needing to go through this to auth user as user may already have key secret pair. which are just to be checked if right or not by any other means.

  1. It will be fed to pipe for various REST requests to be performed by pipe. It needed one of the pipe module containing credentials. Shifting to (or adding key secret pair) resulted in its need.

plus. When I asked summers about need. he said its not exactly we can't so with existing code and said to extend AuthenticationModule. But as authz was already being used and have prettier code. So I considered using it .

Sorry for so long text. Was not getting ho to compress the points. :)

danielpassos commented 8 years ago

Gotcha! It make me confused because basic auth is is part of auth but has you sad the project is using authz. Anyway, could you please add some code using it, to we can see it really working?

danielpassos commented 8 years ago

@secondsun Could you please take a look of that?

openwarrior commented 8 years ago

@danielpassos I have approx entire code ready but that is not good in looks at present. So don't want to send pul req with that. Can i place that to my repository to show?

openwarrior commented 8 years ago

I am needing to close this request. will work on it locally and resubmit. Thanks