HttpRequest.Auth

public class Auth

The authentication parameters for a request.

Fields

appId

String appId

authType

String authType

email

String email

from

String from

userId

Integer userId

Constructors

Auth

public Auth(String type)

Authenication parameters will be initialized by the framework. So, the application will never use this constructor

Methods

email

public String email()

Email of the user requesting

Returns:string email id of the requesting user

from

public String from()

If the URL is requested from other apps or an external source, this method will identify the remote source. If the request is made by internal applications, from will return the app source in the format ‘provider_code/app_code’

Returns:String remote requester’s name

isAnonymous

public boolean isAnonymous()

Check if the request is made by an unauthenticated source.

Returns:Boolean, true if request is anonymous else false.

isCookie

public boolean isCookie()

Check if the request is made by a human user identified by HTTP cookies

Returns:Boolean, true if authenticated using cookie else false.

isExternalServer

public boolean isExternalServer()

Check if the request made from external source

Returns:Boolean, true if request by external source else false.

isInternal

public boolean isInternal()

Check if the request made by other applications

Returns:True if made by other applications else False.

userId

public Integer userId()

ID of the user if obtained

Returns:integer value of the user ID