Unternehmensportale, SAP Portal und SAP NetWeaver Forum

04.09.2010, 00:24 Uhr
News | Downloads | Literatur | Links | Diskussionsforen | Impressum 
Suchen   
Hauptmenü

Online
Aktuell 2 Gäste und 1 registrierter Benutzer online.

Anmeldung

Foren

[pnForum Suche] [pnForum Übersicht]
Anmerkung: keine Berechtigung, Beiträge zu verfassen :: Registrierung/Anmeldung
 
SAP Netweaver :: mySAP Enterprise Portals :: SSO von Enterprise Portal zu Outlook WebMail
moderiert von: PHoefer
gehe zu Seite ( vorherige Seite 1 | 2 )
AutorSSO von Enterprise Portal zu Outlook WebMail
PHoefer

Beiträge: 1

verfasst:
28.04.2004, 17:25 Uhr   

Hello Bregne,

i didnt found a very good soultion up to now.

To make it run you can override the Microsoft Internetexplorer Security Patch with an entry in the regestry. It is describt in here:

Microsoft Note

It is more a problem as i tink. For Form based login i have write an small iview (it is Beta state in the moment) that sends an dynamic URL (or Javascript for http post) to the client. Then the client make a login to the OWA Webserver an it works. For basic authentication i write this small code (i post it in the next Posting). Dont use it, it dosnt works!

What the iView makes: It will connect to a Webserver, and will send the username and password (base64 encoded) to the Webserver. then it gets the HTML Stream and will send it to the Client. It works fine with my testfile icon_cool .

But from the OWA Server i get a webpage with Gifs and Frames that the client also would get from the OWA Server. BUT the Client was NOT authenticated to the Webserver - the Portalserver was authenticated (because there runs my URL_Connector objekt). I found an Outlook webaccess Portlet for an Sybase Portal (never hear about this before) and take a look how they do it. they use a proxy class and rewrite the full html-code. I have decided that this was to much work for me.

Here is the code for the authenticator iView. It works for access single html-pages:



<fieldset style="background-color: #cccccc; text-align: left; border: 1px solid black;"><legend style="font-weight: bold;">Code</legend>
<div class="php">
    <li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package hoefer.ba;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/**</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @author Patrick Höfer</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import java.net.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import java.io.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color: #000000; font-weight: bold;">class</span> URL_Connector</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    public <span style="color: #000066;">static</span> InputStream openAuthorizedStream<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        URL url,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String name,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String passwd<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        throws IOException</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">{</span>      </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        URLConnection conn = url.openConnection<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;  </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #808080; font-style: italic;">/*  String key = "useragent";</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        String value = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)";</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        conn.setRequestProperty(key,value);</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        conn.setRequestProperty("accept-language", "de");</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        conn.setRequestProperty("accept-encoding", "gzip, deflate");</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        conn.setRequestProperty("connection", "Keep-Alive");</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">        conn.setDoInput(true); */</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        conn.setRequestProperty<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #ff0000;">"Authorization"</span>,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            userNamePasswordBase64<span style="color: #66cc66;">(</span>name, passwd<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        conn.connect<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;  </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        conn.setAllowUserInteraction<span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #b1b100;">return</span> conn.getInputStream<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    private <span style="color: #000066;">static</span> String userNamePasswordBase64<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String username,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String password<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String s = username + <span style="color: #ff0000;">":"</span> + password;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String encs = <span style="color: #000000; font-weight: bold;">new</span> sun.misc.BASE64Encoder<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>.encode<span style="color: #66cc66;">(</span>s.getBytes<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #b1b100;">return</span> <span style="color: #ff0000;">"Basic "</span> + encs;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span> </div>
</div>
</fieldset>

<fieldset style="background-color: #cccccc; text-align: left; border: 1px solid black;"><legend style="font-weight: bold;">Code</legend>
<div class="php">
    <li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package hoefer.ba;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.component.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.resource.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import hoefer.ba.URL_Connector;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import java.net.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import java.io.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.component.AbstractPortalComponent;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.component.IPortalComponentRequest;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.component.IPortalComponentResponse;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import com.sapportals.portal.prt.pom.IEvent;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import javax.servlet.http.*;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color: #000000; font-weight: bold;">class</span> Basic_Authenticator extends AbstractPortalComponent</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    public void doContent<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        IPortalComponentRequest request,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        IPortalComponentResponse response<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">{</span>      </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #808080; font-style: italic;">// will never be invoked, since 'getServletResponse(true)' (see above)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    protected void doOnNodeReady<span style="color: #66cc66;">(</span>IPortalComponentRequest request, IEvent arg1<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        String page = <span style="color: #000000; font-weight: bold;">new</span> String<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        try</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            BufferedReader in = getHtmlStream<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            String temp = in.readLine<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span>temp<span style="color: #66cc66;">)</span> != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                page = page + temp;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                temp = in.readLine<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        catch <span style="color: #66cc66;">(</span>Exception e<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #808080; font-style: italic;">//response.write("dies ist ein Test");</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        HttpServletResponse responseJava = request.getServletResponse<span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        responseJava.setContentType<span style="color: #66cc66;">(</span><span style="color: #ff0000;">"text/html"</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        </div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        try</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            PrintWriter out = responseJava.getWriter<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            out.println<span style="color: #66cc66;">(</span>page<span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        catch <span style="color: #66cc66;">(</span>Exception e<span style="color: #66cc66;">)</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    public BufferedReader getHtmlStream<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> throws Exception</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">{</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        URL url = <span style="color: #000000; font-weight: bold;">new</span> URL<span style="color: #66cc66;">(</span><span style="color: #ff0000;">"http://www.yourdomain.de"</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        BufferedReader in =</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            <span style="color: #000000; font-weight: bold;">new</span> BufferedReader<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                <span style="color: #000000; font-weight: bold;">new</span> InputStreamReader<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    URL_Connector.openAuthorizedStream<span style="color: #66cc66;">(</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        url,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #ff0000;">"username"</span>,</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #ff0000;">"password"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #b1b100;">return</span> in;</div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #66cc66;">}</span></div><li style="color: blue; font-weight: bold;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span> </div>
</div>
</fieldset>

So my conclusion is: Upgrade the OWA and use Form-Based Login or change the registry on evry client (and have a lot of fun with your security department icon_wink ).

Best Regards,

Patrick
 
gehe zu Seite ( vorherige Seite 1 | 2 )


Allgemeine Nutzungsbedingungen | Datenschutzhinweis   
mindsquare - SAP NetWeaver Development | SAP Karriere bei mindsquare | SAP Trainee bei mindsquare | sap interactive forms | Risikomanagement

Fatal error: Call to a member function Execute() on a non-object in /var/www/html/web524/html/Domains/Unternehmensportale/includes/pnSession.php on line 378