@BRT.LoginAs()
Allows access to secure pages from links in the Brick River Web Console
Adding @BRT.LoginAs() to a layout makes it possible for users to access a secure portal using links in the Brick River Web Console. The Helper uses a single parameter - 'ViewId:' to indicate the View from which portal users are authenticated.
The targeted View must include the <ActionLinks> element with an HTML attribute indicating the page to be launched.
For example, if Users are to be authenticated using the People View:
The layout used for portal pages must include @BRT.LoginAs(viewId:"People")
@functions{
protected EngineRecord _user = null;
public override void InitializePage() {
BRT.LoginAs(viewId:"People");
base.InitializePage();
if (Request.QueryString["logout"] == "logout") {
BRT.Logout();
Response.Redirect("/securepage");
}
else
{
_user = BRT.UserRecord(viewId:"People", fields: new[] {"FirstName","LastName","Username"});
}
}
}
The XML Overlay for the People View must include:
<ActionLinks>
<ActionLink Href="http://demo-testsite.brtsite.com/securepage/loginas" Label="Secure Page" Secure="true" />
</ActionLinks>
From the Brick River Web Console, it is now possible to open a user record from the People View , click the Actions Button, and use the link provided (labeled: "Secure Page" in the <ActionLink> example above).
Required Parameters
viewId: Indicates the View which contains the record set to be targeted by the Helper
Example: viewId:"BlogPosts"
viewId: Indicates the View which contains the record set to be targeted by the Helper
Example: viewId:"BlogPosts"
The viewID: parameter indicates the View targeted by the Helper. The View can be either visible or invisible to users in the Web Console.