cancel
Showing results for 
Search instead for 
Did you mean: 

read Arafia client user name in android app

Former Member
0 Kudos

HI Friends,

I have small doubt.

Is it possible to read Afaria client user name and password in android application which is deployed through afaria server?

If yes, how to read?

Thanks in advance

sures

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Suresh,

You need to make use of AfariaSLL.jar library in order to access Afaria Client from your application.

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Joshi,

I added latest AfariaSLL.jar library to my project.

Could  you provide me any sample code, regarding how to read?

Thanks

suresh

Former Member
0 Kudos

Hi,

Download the Afaria SSL from frontline.sybase.com it include the sample code

Former Member
0 Kudos

Hi Chetan Dalvi,

Thanks for input..

Actually we are customizing HWC , Once user connected to afaria client, no need to enter any settings in HWC. HWC should automatically connect to SMP server.

Now we are hard coding server name,port, formID, urlsuffix and registration method.

For Afaria registration method we need to pass challenge code and common name in HWC correct.

BUt we don't know what is

challenge code

common name

If you tell us what is

challenge code

common name

that will help us,

Note: We are using smp2.3 and afaria7 sp2

thanks in advance

suresh

0 Kudos

Hi Suresh,

You can keep configuration file for your application on Afaria server and then fetch it in your application using AfariaSLL library from Afaria Client using below sample.

A SeedDataAPI object can be instantiated as follows, being sure to use your app's own context:


SeedDataAPI.

initialize(this);


To retrieve a configuration file:


SeedDataCredentials sdc =

new SeedDataCredentials("user", "pass");


String SeedFileLocation = SeedDataAPI.

retrieveSeedData(sdc);

When you launch application first time, it should ideally tell Afaria Client to fetch the configuration file and then you should pick those values.

You need not have to hard code any details and directly update the configuration file on Afaria server so that all applications will get it from Afaria Client.

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek Joshi,

Thanks for input.

1.which user credentials are theses. Admin or individual user credentials of active directory

SeedDataCredentials sdc =

new SeedDataCredentials("user", "pass");

2.What is common name and challenge code,

so that i can fill these two also in configuration file

Thanks in advance

sureshb

0 Kudos

Hi Suresh,

These are your Afaria client credentials which you need to set here.

On Afaria server, go to your application policy and select configuration. Here you can upload Text file binary file or provide Text there itself. please check below sample of Text on Afaria server below:

servername=relayserver.sybase.com;serverport=80;companyid=XXX.YYY.

Could you please let me know what is this challange code? If this is SCEP challange on your CA then it should not be provided in your application.

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek,

Thanks for input...

How HWC in mobile will connect to SMP server using afaria registration.

If i select the registration method as Automatic(Afaria Certificate)

It is asking for common name and challenge code as below

Which values we need to enter here. I installed the afaria client and it connected to afaria server in same emulator.

Thanks

Suresh

0 Kudos

Hi Suresh,

Common Name is your CA's common name (which you provided in Afaria server configuration).

Challange code is SCEP challange on top of your CA (if you have installed SCEP module additionally over CA).

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek Joshi,

Thanks for help..

How to create SCEP challenge password?

Where we need to create?

I have root CA and we tick the SCEP enabled in Afaria server.

Thanks in advance

suresh

0 Kudos

Hi Suresh,

One way of doing is manually retreive the challange OTP (one time password) from your SCEP protected CA server.

In order to do this, you need to go to http://<CA_HOST>:<CA_PORT>/CertSrv/mscep_admin and provide user/password to authenticate (if asked) and get the challange and use in your application.

Your Admin should provide you challange as and when requested for use.

Third option is to check the box "SCEP Challange" on Afaria server and provide all required information i.e. Domain, User, Password, Confirm" then you can keep this parameter empty in the API and Afaria server will fetch the challange and add in your request.

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek Joshi,

Thanks for replay,

we provided the settings in configuration

servername=relayserver.sybase.com;serverport=80;companyid=XXX.YYY

In HWC these settings are comming perfectly fine.

I have small doubt regarding SCEP challenge password.

http://<CA_HOST>:<CA_PORT>/CertSrv/mscep_admin

this url is not working it saying "404 - File or directory not found"

i given my host and port

1.Is we need to install SCEP on root CA server also, we installed it in afaria server.

2.To get the afaria client user name using  SeedDataCredentials

It is asking user and pass, But our requirement is to get user name of afaria client

UserInfo userInfo = new UserInfo(user);

                        SeedDataCredentials          sdc = new SeedDataCredentials(userInfo.getM_UserName(),userInfo.getM_Domain(), pass);

tahir_z
Contributor
0 Kudos

Hi Suresh,

In order to get username,servername or etc.. in HWC container and access it through hwc application then you need to write a phonegap plugin.

Check blogs,

http://scn.sap.com/community/mobile/blog/2013/06/04/building-phonegap-native-plugin-for-hwc-containe...

Regards

Tahir

Former Member
0 Kudos

HI Tahir,

Nice Blog.

Thanks for replay..

Our requirement is, we need to read Afaria client user name in android  HWC. apk  (Customized

one). We are planning to use registration method as Automatic ( Afaria certificate) as shown below. How to register to SMP server using Automatic (Afaria Certificate) registration method

Thanks

suresh

tahir_z
Contributor
0 Kudos

Hi Suresh,

Do you want to read Afaria client username in container app or in hwc app ?

Scenoria could be as follow,

First you need to configure Authentication provider in SMP server. If Afaria server configured with active directory so you configure AD to SMP as well. Im assuming Comman Name and Challenge Code are active directory user credeantial. Once you get them on hwc it will register in SMP.

Regards

Tahir

Former Member
0 Kudos

Dear Tahir,

Thanks for replay.

1.Yes we need to read Afaria client user name in container app not in HWC app. How to get afaria client user name in container app?

2.We configured active directory to SMP server. Its working fine.

But when we select the Registration method as Automatic ( Afaria Certificate ) and if we enter user name of active directory as common name and challenge code as active directory password. Its not connecting to SMP server.

Our view is we given already active directory user name and password in Afaria client,

So in HWC container no need to enter any challenge code and common name again, is it correct?

if no what is the use of Registration method as Automatic ( Afaria Certificate )

Thanks in advance

suresh

0 Kudos

Hi Suresh,

As i mentioned, if you Afaria server has all proper SCEP module details filled then no need of providing the challange code and CA again.

On your SMP server you need to add your Afaria CA cert into trust store so that it will accept certificate issued by Afaria CA to your device/application.

Also, if you want to use the same certificate for backend also (from where SMP will get data), there also you would need to make Afaria CA cert trusted.

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek Joshi,

Thanks for replay

Yes Afaria server having all proper SCEP module details.


Now we added, On SMP server our Afaria CA cert into trust store. ( .cer format certificate)

Uninstalled existing HWC app.

and we downloaded the app from Android app store and select the registration method as Automatic ( Afaria Certificate ) and entered the other details rather than common name and challenge code. Then save button is not enabled to save.

Hence we entered only common name and saved HWC is not connecting to SMP server, In the log it is showing "Authentication failed".

What else we need to do?

Thanks in advance

suresh

0 Kudos

Hi Suresh,

In this case, could you please enable the log level on SMP server to Debug for Security component and try again to collect the logs.

Could you please also let me know what kind of security configuration you are using on SMP server (i hope it would be certificateLoginModule) and also you are hitting SMP server through relay server?

Regards,

Abhishek Joshi

Former Member
0 Kudos

Hi Abhishek Joshi,

Thanks for replay..

We are using LDAP security configuration. Now we created certificateAuthorizationLoginModule, Still we not able to connect to SMP server. In the log I can see " LDAP connection authentication faled, empty password". 

LDAP is in default security configuration. We cant make security configuration certificateAuthorizationLoginModule as default.

Please advice...

still we are trying we will update  you the result..

Thanks

suresh 

0 Kudos

Hi Suresh,

I am not sure why you are using LDAP security configuration as you need to do certificate login. When you use certificate for onboarding and request response then you would require to use certificateLoginModule. I think your Afaria server is also connected to same LDAP hence user is already authenticated and you might not want to do the same authentication again.

Anyway, if you want to stick to it then you can try to attach basic auth header also in your request from application. But in this case same basic auth header will also reach backend and will be used as login credentials.

Also instead of LDAPLoginModule and CertificateLoginModule, you can use SSOLoginModule as crt you received is a user cert and same cert will be used for backend authentication also. In this, make sure that you are Mutual HTTPS backend endpoint in the configuration and trust the Afaria CA cert as well.

Regards,

Abhishek Joshi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I believe you cant read the username and password variable of Afaria client.

For user name you can view the user name details on afaria console

Former Member
0 Kudos

Hi Chetan,

Thanks for input...

I have one more doubt.

what is the challenge password and common name (afaria registration method) in HWC settings?

thanks in advance

G.suresh

Former Member
0 Kudos

Hi,

Download AfariaSSL Library from frontline.sybase.com .

Sample code is also available for the same .