Class AccessToken
-
- All Implemented Interfaces:
public final class AccessTokenAccess tokens are required to connect to the server.
Once information is filled out, create the token string with toJwt.
https://docs.livekit.io/home/get-started/authentication/
-
-
Field Summary
Fields Modifier and Type Field Description private Longttlprivate Dateexpirationprivate DatenotBeforeprivate Stringnameprivate Stringidentityprivate Stringmetadataprivate Stringsha256private final <Error class: unknown class>attributesprivate StringroomPresetprivate <Error class: unknown class>roomConfiguration
-
Constructor Summary
Constructors Constructor Description AccessToken(String apiKey, String secret)
-
Method Summary
Modifier and Type Method Description final LonggetTtl()Amount of time in milliseconds the created token is valid for. final UnitsetTtl(Long ttl)Amount of time in milliseconds the created token is valid for. final DategetExpiration()Used to specify a expiration time. final UnitsetExpiration(Date expiration)Used to specify a expiration time. final DategetNotBefore()Date specifying the time before which this token is invalid . final UnitsetNotBefore(Date notBefore)Date specifying the time before which this token is invalid . final StringgetName()Display name for the participant, available as Participant.namefinal UnitsetName(String name)Display name for the participant, available as Participant.namefinal StringgetIdentity()Unique identity of the user, required for room join tokens final UnitsetIdentity(String identity)Unique identity of the user, required for room join tokens final StringgetMetadata()Custom metadata to be passed to participants final UnitsetMetadata(String metadata)Custom metadata to be passed to participants final StringgetSha256()For verifying integrity of message body final UnitsetSha256(String sha256)For verifying integrity of message body final <Error class: unknown class>getAttributes()Key/value attributes to attach to the participant final StringgetRoomPreset()Use a named preset room configuration. final UnitsetRoomPreset(String roomPreset)Use a named preset room configuration. final <Error class: unknown class>getRoomConfiguration()Configuration for when creating a room. final Unit)>setRoomConfiguration(<Error class: unknown class> roomConfiguration)Configuration for when creating a room. final UnitaddGrants(VideoGrant grants)Add VideoGrant to this token. final UnitaddGrants(Iterable<VideoGrant> grants)Add VideoGrant to this token. final UnitclearGrants()Clear all previously added VideoGrants. final UnitaddSIPGrants(SIPGrant grants)Add VideoGrant to this token. final UnitaddSIPGrants(Iterable<SIPGrant> grants)Add VideoGrant to this token. final UnitclearSIPGrants()Clear all previously added SIPGrants. final StringtoJwt()-
-
Method Detail
-
getTtl
final Long getTtl()
Amount of time in milliseconds the created token is valid for.
If expiration is not null, this value is ignored.
Defaults to 6 hours.
-
setTtl
final Unit setTtl(Long ttl)
Amount of time in milliseconds the created token is valid for.
If expiration is not null, this value is ignored.
Defaults to 6 hours.
-
getExpiration
final Date getExpiration()
Used to specify a expiration time.
If not null, takes preference over ttl.
-
setExpiration
final Unit setExpiration(Date expiration)
Used to specify a expiration time.
If not null, takes preference over ttl.
-
getNotBefore
final Date getNotBefore()
Date specifying the time before which this token is invalid .
-
setNotBefore
final Unit setNotBefore(Date notBefore)
Date specifying the time before which this token is invalid .
-
setName
final Unit setName(String name)
Display name for the participant, available as
Participant.name
-
getIdentity
final String getIdentity()
Unique identity of the user, required for room join tokens
-
setIdentity
final Unit setIdentity(String identity)
Unique identity of the user, required for room join tokens
-
getMetadata
final String getMetadata()
Custom metadata to be passed to participants
-
setMetadata
final Unit setMetadata(String metadata)
Custom metadata to be passed to participants
-
getAttributes
final <Error class: unknown class> getAttributes()
Key/value attributes to attach to the participant
-
getRoomPreset
final String getRoomPreset()
Use a named preset room configuration.
Any options set in roomConfiguration will take precedence.
-
setRoomPreset
final Unit setRoomPreset(String roomPreset)
Use a named preset room configuration.
Any options set in roomConfiguration will take precedence.
-
getRoomConfiguration
final <Error class: unknown class> getRoomConfiguration()
Configuration for when creating a room.
-
setRoomConfiguration
final Unit )>setRoomConfiguration(<Error class: unknown class> roomConfiguration)
Configuration for when creating a room.
-
addGrants
final Unit addGrants(VideoGrant grants)
Add VideoGrant to this token.
-
addGrants
final Unit addGrants(Iterable<VideoGrant> grants)
Add VideoGrant to this token.
-
clearGrants
final Unit clearGrants()
Clear all previously added VideoGrants.
-
addSIPGrants
final Unit addSIPGrants(SIPGrant grants)
Add VideoGrant to this token.
-
addSIPGrants
final Unit addSIPGrants(Iterable<SIPGrant> grants)
Add VideoGrant to this token.
-
clearSIPGrants
final Unit clearSIPGrants()
Clear all previously added SIPGrants.
-
-
-
-