Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions dotnet/src/dotnetframework/GxClasses/Middleware/GXHttpServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,28 @@ public GXOAuthLogout()

public override void webExecute()
{
string genexus_agent = localHttpContext.Request.Headers["Genexus-Agent"];
try
{
GxSecurityProvider.Provider.oauthlogout(context);
GxSecurityProvider.Provider.oauthlogout(context, out string URL, out short statusCode);

if (statusCode == (int)HttpStatusCode.SeeOther)
localHttpContext.Response.StatusCode = (int)HttpStatusCode.OK;
else
localHttpContext.Response.StatusCode = statusCode;

JObject jObj = new JObject();
if (genexus_agent == "WebFrontend Application" && URL.Length > 0)
{
localHttpContext.Response.AddHeader("GXLocation", URL);
jObj.Put("GXLocation", URL);
}
else
{
jObj.Put("code", statusCode.ToString());
}
localHttpContext.Response.Write(jObj.ToString());
localHttpContext.Response.ContentType = MediaTypesNames.ApplicationJson;
localHttpContext.Response.StatusCode = 200;
localHttpContext.Response.Write(new JObject().ToString());
context.CloseConnections();
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface ISecurityProvider
GxResult oauthauthentication(IGxContext context, String grantType, String userName, String userPassword, String clientId, String clientSecret, String scope, String additionalParameters, out OutData outData, out String URL, out bool flag);
void oauthgetuser(IGxContext context, out String userJson, out bool isOK);
void oauthlogout(IGxContext context);

void oauthlogout(IGxContext context, out String URL, out short statusCode);
}
public class GxSecurityProvider
{
Expand Down Expand Up @@ -161,6 +161,12 @@ public void oauthgetuser(IGxContext context, out string userJson, out bool isOK)
public void oauthlogout(IGxContext context)
{
}

public void oauthlogout(IGxContext context, out string URL, out short statusCode)
{
URL = string.Empty;
statusCode = 0;
}
}

}