Authlete
Property Class Reference

A property associated with an access token and/or an authorization code. Some Authlete APIs accept a "properties" request parameter. The value of the parameter is an array of Property. More...

Public Member Functions

 Property ()
 The default constructor. This is an alias of Property(null, null, false). More...
 
 Property (string key, string value)
 Constructor with a pair of key and value. This is an alias of Property(key, value, false). More...
 
 Property (string key, string value, bool hidden)
 Constructor with a pair of key and value, and a flag to mark this property as hidden or not. More...
 

Properties

string Key [get, set]
 The name of this property. More...
 
string Value [get, set]
 The value of this property. More...
 
bool IsHidden [get, set]
 The flag which indicates whether this property is hidden from the client application or not. More...
 

Detailed Description

A property associated with an access token and/or an authorization code. Some Authlete APIs accept a "properties" request parameter. The value of the parameter is an array of Property.

Constructor & Destructor Documentation

◆ Property() [1/3]

Property ( )
inline

The default constructor. This is an alias of Property(null, null, false).

◆ Property() [2/3]

Property ( string  key,
string  value 
)
inline

Constructor with a pair of key and value. This is an alias of Property(key, value, false).

Parameters
keyThe name of this property.
Parameters
valueThe value of this property.

◆ Property() [3/3]

Property ( string  key,
string  value,
bool  hidden 
)
inline

Constructor with a pair of key and value, and a flag to mark this property as hidden or not.

Parameters
keyThe name of this property.
Parameters
valueThe value of this property.
Parameters
hiddentrue to mark this property as hidden. Read the description about IsHidden for details.

Property Documentation

◆ IsHidden

bool IsHidden
getset

The flag which indicates whether this property is hidden from the client application or not.

If a property is not hidden, information about the property will be sent back to the client application with an access token. For example, if you set the "properties" request prameter as follows when you call Authlete's /api/auth/token API,

"properties": [
{
"key": "example_parameter",
"value": "example_value",
"hidden": false
}
]

The value of the "responseContent" response parameter in the response from the API will contain the pair of "example_parameter" and "example_value" like below.

"responseContent":
"{\"access_token\":\"(abbrev)\",\"example_parameter\":\"example_value\",...}"

and this will result in that the client application will receive a JSON which contains the pair like the following.

{
"access_token": "(abbrev)",
"example_parameter": "example_value",
...
}

On the other hand, if you mark a property as hidden like below,

"properties": [
{
"key": "hidden_parameter",
"value": "hidden_value",
"hidden": true
}
]

the client application will never see the property in any response from your authorization server. However, of course, the property is still associated with the access token and it can be confirmed by calling Authlete's /api/auth/introspection API (which is an API to get information about an access token). A response from the API contains all properties associated with the given access token regardless of whether they are hidden or visible. The following is an example response from Authlete's /api/auth/introspection API.

{
"type":"introspectionResponse",
"resultCode":"A056001",
"resultMessage":"[A056001] The access token is valid.",
"action":"OK",
"clientId":5008706718,
"existent":true,
"expiresAt":1463310477000,
"properties":[
{
"hidden":false,
"key":"example_parameter",
"value":"example_value"
},
{
"hidden":true,
"key":"hidden_parameter",
"value":"hidden_value"
}
],
"refreshable":true,
"responseContent":"Bearer error=\"invalid_request\"",
"subject":"user123",
"sufficient":true,
"usable":true
}

◆ Key

string Key
getset

The name of this property.

◆ Value

string Value
getset

The value of this property.


The documentation for this class was generated from the following file: