# rtsp token

A GstRTSPToken contains the permissions and roles of the user performing the current request. A token is usually created when a user is authenticated by the GstRTSPAuth object and is then placed as the current token for the current request.

GstRTSPAuth can use the token and its contents to check authorization for various operations by comparing the token to the GstRTSPPermissions of the object.

The accepted values of the token are entirely defined by the GstRTSPAuth object that implements the security policy.

Last reviewed on 2013-07-15 (1.0.0)

## GstRTSPToken

An opaque object used for checking authorisations. It is generated after successful authentication.

### Members

`mini_object` (GstMiniObject) –
No description available

## GstRtspServer.RTSPToken

An opaque object used for checking authorisations. It is generated after successful authentication.

### Members

`mini_object` (Gst.MiniObject) –
No description available

## GstRtspServer.RTSPToken

An opaque object used for checking authorisations. It is generated after successful authentication.

### Members

`mini_object` (Gst.MiniObject) –
No description available

### Constructors

#### gst_rtsp_token_new

    GstRTSPToken *
    gst_rtsp_token_new (const gchar * firstfield,
                        ... ...)

Create a new Authorization token with the given fieldnames and values. Arguments are given similar to gst_structure_new.

Parameters:

`firstfield` –

the first fieldname

`...` –

additional arguments

Returns ( [transfer: full]) –

a new authorization token.

#### gst_rtsp_token_new_empty

    GstRTSPToken *
    gst_rtsp_token_new_empty ()

Create a new empty Authorization token.

Returns ( [transfer: full]) –

a new empty authorization token.

#### GstRtspServer.RTSPToken.prototype.new_empty

    function GstRtspServer.RTSPToken.prototype.new_empty(): {
        // javascript wrapper for 'gst_rtsp_token_new_empty'
    }

Create a new empty Authorization token.

Returns (GstRtspServer.RTSPToken) –

a new empty authorization token.

#### GstRtspServer.RTSPToken.new_empty

    def GstRtspServer.RTSPToken.new_empty ():
        #python wrapper for 'gst_rtsp_token_new_empty'

Create a new empty Authorization token.

Returns (GstRtspServer.RTSPToken) –

a new empty authorization token.

#### gst_rtsp_token_new_valist

    GstRTSPToken *
    gst_rtsp_token_new_valist (const gchar * firstfield,
                               va_list var_args)

Create a new Authorization token with the given fieldnames and values. Arguments are given similar to gst_structure_new_valist.

Parameters:

`firstfield` –

the first fieldname

`var_args` –

additional arguments

Returns ( [transfer: full]) –

a new authorization token.

### Methods

#### gst_rtsp_token_get_string

    const gchar *
    gst_rtsp_token_get_string (GstRTSPToken * token,
                               const gchar * field)

Get the string value of field in token.

Parameters:

`token` –

a GstRTSPToken

`field` –

a field name

Returns ( [transfer: none][nullable]) –

the string value of field in token or NULL when field is not defined in token. The string becomes invalid when you free token.

#### GstRtspServer.RTSPToken.prototype.get_string

    function GstRtspServer.RTSPToken.prototype.get_string(field: String): {
        // javascript wrapper for 'gst_rtsp_token_get_string'
    }

Get the string value of field in token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

a GstRtspServer.RTSPToken

`field` (String) –

a field name

Returns (String) –

the string value of field in token or null when field is not defined in token. The string becomes invalid when you free token.

#### GstRtspServer.RTSPToken.get_string

    def GstRtspServer.RTSPToken.get_string (self, field):
        #python wrapper for 'gst_rtsp_token_get_string'

Get the string value of field in token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

a GstRtspServer.RTSPToken

`field` (str) –

a field name

Returns (str) –

the string value of field in token or None when field is not defined in token. The string becomes invalid when you free token.

#### gst_rtsp_token_get_structure

    const GstStructure *
    gst_rtsp_token_get_structure (GstRTSPToken * token)

Access the structure of the token.

Parameters:

`token` –

The GstRTSPToken.

Returns ( [transfer: none]) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token.

MT safe.

#### GstRtspServer.RTSPToken.prototype.get_structure

    function GstRtspServer.RTSPToken.prototype.get_structure(): {
        // javascript wrapper for 'gst_rtsp_token_get_structure'
    }

Access the structure of the token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

Returns (Gst.Structure) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token.

MT safe.

#### GstRtspServer.RTSPToken.get_structure

    def GstRtspServer.RTSPToken.get_structure (self):
        #python wrapper for 'gst_rtsp_token_get_structure'

Access the structure of the token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

Returns (Gst.Structure) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token.

MT safe.

#### gst_rtsp_token_is_allowed

    gboolean
    gst_rtsp_token_is_allowed (GstRTSPToken * token,
                               const gchar * field)

Check if token has a boolean field and if it is set to TRUE.

Parameters:

`token` –

a GstRTSPToken

`field` –

a field name

Returns –

TRUE if token has a boolean field named field set to TRUE.

#### GstRtspServer.RTSPToken.prototype.is_allowed

    function GstRtspServer.RTSPToken.prototype.is_allowed(field: String): {
        // javascript wrapper for 'gst_rtsp_token_is_allowed'
    }

Check if token has a boolean field and if it is set to true.

Parameters:

`token` (GstRtspServer.RTSPToken) –

a GstRtspServer.RTSPToken

`field` (String) –

a field name

Returns (Number) –

true if token has a boolean field named field set to true.

#### GstRtspServer.RTSPToken.is_allowed

    def GstRtspServer.RTSPToken.is_allowed (self, field):
        #python wrapper for 'gst_rtsp_token_is_allowed'

Check if token has a boolean field and if it is set to True.

Parameters:

`token` (GstRtspServer.RTSPToken) –

a GstRtspServer.RTSPToken

`field` (str) –

a field name

Returns (bool) –

True if token has a boolean field named field set to True.

#### gst_rtsp_token_set_bool

    gst_rtsp_token_set_bool (GstRTSPToken * token,
                             const gchar * field,
                             gboolean bool_value)

Sets a boolean value on token.

Parameters:

`token` –

The GstRTSPToken.

`field` –

field to set

`bool_value` –

boolean value to set

Since : 1.14

#### GstRtspServer.RTSPToken.prototype.set_bool

    function GstRtspServer.RTSPToken.prototype.set_bool(field: String, bool_value: Number): {
        // javascript wrapper for 'gst_rtsp_token_set_bool'
    }

Sets a boolean value on token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

`field` (String) –

field to set

`bool_value` (Number) –

boolean value to set

Since : 1.14

#### GstRtspServer.RTSPToken.set_bool

    def GstRtspServer.RTSPToken.set_bool (self, field, bool_value):
        #python wrapper for 'gst_rtsp_token_set_bool'

Sets a boolean value on token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

`field` (str) –

field to set

`bool_value` (bool) –

boolean value to set

Since : 1.14

#### gst_rtsp_token_set_string

    gst_rtsp_token_set_string (GstRTSPToken * token,
                               const gchar * field,
                               const gchar * string_value)

Sets a string value on token.

Parameters:

`token` –

The GstRTSPToken.

`field` –

field to set

`string_value` –

string value to set

Since : 1.14

#### GstRtspServer.RTSPToken.prototype.set_string

    function GstRtspServer.RTSPToken.prototype.set_string(field: String, string_value: String): {
        // javascript wrapper for 'gst_rtsp_token_set_string'
    }

Sets a string value on token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

`field` (String) –

field to set

`string_value` (String) –

string value to set

Since : 1.14

#### GstRtspServer.RTSPToken.set_string

    def GstRtspServer.RTSPToken.set_string (self, field, string_value):
        #python wrapper for 'gst_rtsp_token_set_string'

Sets a string value on token.

Parameters:

`token` (GstRtspServer.RTSPToken) –

The GstRtspServer.RTSPToken.

`field` (str) –

field to set

`string_value` (str) –

string value to set

Since : 1.14

#### gst_rtsp_token_writable_structure

    GstStructure *
    gst_rtsp_token_writable_structure (GstRTSPToken * token)

Get a writable version of the structure.

Parameters:

`token` –

A writable GstRTSPToken.

Returns ( [transfer: none]) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token. This function ensures that token is writable, and if so, will never return NULL.

MT safe.

#### GstRtspServer.RTSPToken.prototype.writable_structure

    function GstRtspServer.RTSPToken.prototype.writable_structure(): {
        // javascript wrapper for 'gst_rtsp_token_writable_structure'
    }

Get a writable version of the structure.

Parameters:

`token` (GstRtspServer.RTSPToken) –

A writable GstRtspServer.RTSPToken.

Returns (Gst.Structure) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token. This function ensures that token is writable, and if so, will never return null.

MT safe.

#### GstRtspServer.RTSPToken.writable_structure

    def GstRtspServer.RTSPToken.writable_structure (self):
        #python wrapper for 'gst_rtsp_token_writable_structure'

Get a writable version of the structure.

Parameters:

`token` (GstRtspServer.RTSPToken) –

A writable GstRtspServer.RTSPToken.

Returns (Gst.Structure) –

The structure of the token. The structure is still owned by the token, which means that you should not free it and that the pointer becomes invalid when you free the token. This function ensures that token is writable, and if so, will never return None.

MT safe.

## Function Macros

### GST_RTSP_TOKEN_CAST

    #define GST_RTSP_TOKEN_CAST(obj)   ((GstRTSPToken*)(obj))

The results of the search are