cancel
Showing results for 
Search instead for 
Did you mean: 

How to distinguish between internet & intranet user?

Former Member
0 Kudos

Hi,

we are on EP6 sp13.

we have 2 types of scenarios:

1) users logging from internet

2) users logging from intranet

>>>>>>> 1) user from internet will access the portal as follows:

https://sap1.name1.ae:8443/irj/portal(where 8443 -- https port of the webdispatcher)

>>>>>>> 2) user from intranet will access the portal as follows:

http://sapportal.domainname.net:50000/irj/portal

We are facing some problems accessing the webdynpro & transaction iViews through internet via https.

So, We want to use the <b>Dynamic System Resolution</b> (http://help.sap.com/saphelp_nw04/helpdata/en/21/dfd241cb76c417e10000000a155106/frameset.htm) for this.

The idea is to make the resolution of the system dynamic. That means we define two system objects (one for remote and one for local) aliased "SystemXYZ_intranet" and "SystemXYZ_extranet". During the computation of a webdynpro URL the AppIntegrator will resolve the value of the parameter "System". The iView will contain the value "SystemXYZ". If thecustomer is outside the intranet, it will return "SystemXYZ_extranet".

I need to create a system resolving service based on whether the user is an intranet user or internet user??

How to distinguish whether the logged on user is an internet user or intranet user?

Can any1 help me on the same.

Awaiting your inputs.

Cheers,

SK.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

SK,

You can do this by developing a Custom Login Module that uses the UME API to move the user into a user group for Internet users or Intranet users, which the DSR service can access via the IUser object passed to the DSR through the parameter of:

public String getAlternativeSystem(IUser user, String alias)

using

user.getParentGroups(true);

and iterating through the groups until you match the groupname or id to the one you moved the user into in the login module.

Seems to work fine for us.

Cheers,

Steve

Former Member
0 Kudos

hi steve,

Thanks for the reply.

But, even to move the user into a userGroup i need to distinguish b/w an internet and an intranet user right ??

How do i do that? any sample code for that ?? plz share it with me..

cheers,

SK

Former Member
0 Kudos

Hi,

I have also looked in the weblog: https://weblogs.sdn.sap.com/pub/wlg/1432

We have different portal-systems to get data as transaction iViews (from ECC system) and

webdynpro iViews (from EP system).

I have created 2 additional systems in portal with alias names system1_intranet and

system2_internet for this DSR thing.

system1 properties:

WAS hostname: sapmachine2.domain.net:50000

WAS protocol: http

system2 properties:

WAS hostname: name.company.com:8443

WAS protocol: https

P.S.:: 8443 is the https port and 80 is the http port of the SAP webdispatcher

No user is an anonymous user. All users are assigned to a concerned roles (ess_role, manager_role etc..)

Consider a user with portal user-id 12345 (say). He can login both from intranet and internet with the same user-id. (i.e. we don't have any groups created to distinguish intranet and internet/extranet users)

I am not able to figure out the following:

internet user : how to figure out that 12345 is logging in from internet and route it to system2_internet through this DSR service.

intranet user: how to figure out that 12345 is logging in from intranet and route it to system1_intranet through this DSR service.

An internet user will access the portal using the URL https://sap1.name1.ae:8443/irj/portal and intranet user will access the portal using URL http://sapportal.domainname.net:50000/irj/portal

<b>In mappingService class --> checkUser() method --> I am not able to figure out how to know whether the user is from internet or intranet when i only have 'IUser' object

There should be some way to capture this current URL of the browser using Java in my service??? so that i can know whether the logged in user is an internet or intranet user ?? right ??</b>

Please find below my code.

<i>Interface of portal service:</i>



package com.portal.dynamicsystem;
 

import com.sap.security.api.IUser;
import com.sapportals.portal.prt.service.IService;

public interface ImappingService extends IService
{
    public static final String KEY = "DSRservice.mappingService";
    
	public String getAlternativeSystem(IUser user, String alias);
}

<i>Portal service:</i>


package com.portal.dynamicsystem;

import com.sap.security.api.IGroup;
import com.sap.security.api.IGroupFactory;
import com.sap.security.api.IUser;
import com.sap.security.api.UMException;
import com.sap.security.api.UMFactory;
import com.sapportals.portal.prt.service.IService;
import com.sapportals.portal.prt.service.IServiceContext;

public class mappingService implements ImappingService, IService {

	private IServiceContext mm_serviceContext;

	/**
	* Generic init method of the service. Will be called by the portal runtime.
	* @param serviceContext
	*/
	public void init(IServiceContext serviceContext) {
		mm_serviceContext = serviceContext;
	}

	/**
	* This method is called after all services in the portal runtime
	* have already been initialized.
	*/
	public void afterInit() {
	}

	/**
	* configure the service
	* @param configuration
	* @deprecated
	*/
	public void configure(
		com
		.sapportals
		.portal
		.prt
		.service
		.IServiceConfiguration configuration) {
	}

	/**
	* This method is called by the portal runtime
	* when the service is destroyed.
	*/
	public void destroy() {
	}

	/**
	* This method is called by the portal runtime
	* when the service is released.
	* @deprecated
	*/
	public void release() {
	}

	/**
	* @return the context of the service, which was previously set
	* by the portal runtime
	*/
	public IServiceContext getContext() {
		return mm_serviceContext;
	}

	/**
	* This method should return a string that is unique to this service amongst all
	* other services deployed in the portal runtime.
	* @return a unique key of the service
	*/
	public String getKey() {
		return KEY;
	}

	public String getAlternativeSystem(IUser user, String alias) {
		String system = null;
		return (checkUser(user));
	}
	/**
	* This method is not part of the interface and is provided in order
	* to isolate the logic for selecting a system for a specific alias. This 
	* logic could have been placed in the getAlternateSystem() method.
	* 
	* @return the PCD path for a system, or null
	*/

<i>	public String checkUser(IUser user) {

            /* 
             * I am not able to figure out how to know whether the user is from 
             * internet or intranet when i only have 'IUser' object 
             * 
             * */

            if (user from internet)        <b>// how to know this?</b>
                  return <pcd path of the system2>;
            else if (user from intranet)   <b>// how to know this?</b>
                  return <pcd path of the system1>;
            else
                  return null;
	}</i>

}

<i>portalapp.xml</i>


<?xml version="1.0" encoding="utf-8"?>
<application>
	<registry>
	    <entry path="/runtime/alias.mappers/system1_intranet" name="mappingService" type="service"/>
	    <entry path="/runtime/alias.mappers/system2_internet" name="mappingService" type="service"/>
	</registry>
	<application-config>
	    <property name="releasable" value="false"/>
	    <property name="startup" value="true"/>
	    <property name="ServicesReference" value="com.sap.portal.ivs.api_dynamicSystemService"/>
	</application-config>
  <components/>
  <services>
    <service name="mappingService">
      <service-config>
        <property name="className" value="com.portal.dynamicsystem.mappingService"/>
        <property name="startup" value="true"/>
      </service-config>
    </service>
  </services>
</application>

Please help me.

Thanking you in advance.

Regards,

SK.