on 07-06-2004 1:13 AM
Hi all,
I am trying to get my .NET Web application to authenticate against SAP using the .NET Toolkit and following the article: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/enabl... single sign-on for asp.net applications in enterprise portal 6.article.
I have added my web server into the same domain as the SAP Web Application Server and successfully managed to get the SAPSSO2 Cookie. However, I get this error when the toolkit is trying to instantiate a MySAPSso2Ticket, SAP.Web.Security.TicketException: MYSAP_INVALID. From the documentation, it states that Ticket syntactically invalid.
Any ideas what that means and any solutions?
Pls advise!!!
Regards
microlau
Don't care about forum points. I'm glad I could help you.
By the way, thanks for the hint with the URL-Decode in the global.asax. I missed that one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can anyone help me....i need to know what this dstR3 refers to ..............pleaseeeeeeeee
Public Variables that read setting from web.config
Public strAppServerHost As String = ConfigurationSettings.AppSettings("dstR3.AppServerHost")
Public shtSystemNumber As Short = CType(ConfigurationSettings.AppSettings("dstR3.SystemNumber"), Short)
Public shtClient As Short = CType(ConfigurationSettings.AppSettings("dstR3.Client"), Short)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
i need help in pulling the user information from SAP Portal to asp.net applciation....and i see that you were able to get the solution for it, can you please help me to proceed, it will be of great help......
you have asked to use the functiona and declare the funciton methods but im very new to htis concept and i need to know what appsettings to be used in the webcofig file............please let me know ...............thanks so much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wrote a second application that reads out the ticket value, replaces all exclamation marks with %2B and stores it back into the cookie.
When I call this second application before I call the Ticket-Toolkit-Application then everything works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
extend your ticket application so that it displays the value of the ticket toolkit and check if your ticket contains any exclamation marks. In my case this character causes the ticket check to fail.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is some sample code.....Not the best code but it may get you going down the right track.
Put this in a new module so that you can use it for any webform in your app.
Function Is_SSO2Authenticated(ByVal objRequest As System.Web.HttpRequest, ByVal ObjUser As System.Security.Principal.IPrincipal, _
Optional ByRef strErrorMsg As String = "") As Boolean
Dim blnReturnValue As Boolean = False
Try
If IsNothing(objRequest.Cookies("MYSAPSSO2")) = True Then
strErrorMsg = "MySAPSSO2 Cookie not found"
Else
If ObjUser.Identity.IsAuthenticated = False Then
strErrorMsg = "User not authenticated."
Else
If ObjUser.Identity.AuthenticationType <> "MYSAPSSO2" Then
strErrorMsg = "Authenticated by other Authentication Modulue."
Else
blnReturnValue = True
End If
End If
End If
Catch ex As Exception
blnReturnValue = False
strErrorMsg = ex.Message
End Try
Return blnReturnValue
End Function
Public Variables that read setting from web.config
Public strAppServerHost As String = ConfigurationSettings.AppSettings("dstR3.AppServerHost")
Public shtSystemNumber As Short = CType(ConfigurationSettings.AppSettings("dstR3.SystemNumber"), Short)
Public shtClient As Short = CType(ConfigurationSettings.AppSettings("dstR3.Client"), Short)
In your page load
Try
blnAuth = Is_SSO2Authenticated(Request, User, strMessage)
If blnAuth = True Then
Dim objIdent As SAP.Web.Security.MySAPSso2Identity
objIdent = User.Identity
With Me.dstR3
.MySAP_SSO2 = objIdent.TicketString
.AppServerHost = strAppServerHost
.SystemNumber = shtSystemNumber
.Client = shtClient
End With
With Me.YourProxy1
.Connection = Me.YourProxy1.Connection.GetConnection(Me.dstR3.ConnectionString)
.Connection.Open()
End With
If Me.YourProxy1.Connection.IsOpen = True Then
' Do Something
Else
' Display No Connection Error
End If
Else
' Display not authorized error
End If
Catch ex As Exception
' Display All other errors
End Try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First check that your Verify.pse is the correct one.
Also make sure that you have all needed DLLs, espeacially SAPSECU.DLL.
If you are sure that this is Ok, you should try a step-by step procedure:
- Disable the Authentication Module in Web.config.
- In Page_Load of the page try to get the MYSAPSSO2-Cookie.
-UrlDecode it.
- Check that is looks ok (a valid Base64-encoded string).
-Create a new Ticket with the string and the correct PSE file.
Verify the ticket.
If all this works, also the Authentication Module should work (that does all the steps internally).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.