package gitlab-jsoo

  1. Overview
  2. Docs

Authentication Token for accessing GitLab APIs.

Of the several ways provided in GitLab, we currently support:

  • Personal Access Tokens
  • Project Access Tokens
  • OAuth Authorization Codes
type oauth = {
  1. access_token : string;
  2. refresh_token : string;
}
type t =
  1. | AccessToken of string
  2. | OAuthToken of oauth
    (*

    t is the abstract type of a token.

    *)
type grant_type =
  1. | AuthorizationCode
  2. | RefreshToken
val create_url : client_id:string -> redirect_uri:Uri.t -> state:string -> scopes:Gitlab_t.scope list -> unit -> Uri.t
val of_code : client_id:string -> client_secret:string -> ?grant_type:grant_type -> redirect_uri:string -> code:string -> unit -> t option Lwt.t

Retrieve an OAuth Token using the default grant_type AuthorizationCode. Use the refresh_token along with a grant_type of RefreshToken to request a refreshed OAuth Token.

val of_string : string -> t

of_string create an AccessToken.

val to_string : t -> string

to_string token is the string serialization of token.