memos-script/docs/AuthServiceApi.md
2024-04-30 10:31:09 +08:00

7.5 KiB

memos.AuthServiceApi

All URIs are relative to /

Method HTTP request Description
auth_service_get_auth_status POST /api/v1/auth/status GetAuthStatus returns the current auth status of the user.
auth_service_sign_in POST /api/v1/auth/signin SignIn signs in the user with the given username and password.
auth_service_sign_in_with_sso POST /api/v1/auth/signin/sso SignInWithSSO signs in the user with the given SSO code.
auth_service_sign_out POST /api/v1/auth/signout SignOut signs out the user.
auth_service_sign_up POST /api/v1/auth/signup SignUp signs up the user with the given username and password.

auth_service_get_auth_status

V1User auth_service_get_auth_status()

GetAuthStatus returns the current auth status of the user.

Example

from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = memos.AuthServiceApi()

try:
    # GetAuthStatus returns the current auth status of the user.
    api_response = api_instance.auth_service_get_auth_status()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthServiceApi->auth_service_get_auth_status: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

V1User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

auth_service_sign_in

V1User auth_service_sign_in(username=username, password=password, never_expire=never_expire)

SignIn signs in the user with the given username and password.

Example

from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = memos.AuthServiceApi()
username = 'username_example' # str | The username to sign in with. (optional)
password = 'password_example' # str | The password to sign in with. (optional)
never_expire = true # bool | Whether the session should never expire. (optional)

try:
    # SignIn signs in the user with the given username and password.
    api_response = api_instance.auth_service_sign_in(username=username, password=password, never_expire=never_expire)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthServiceApi->auth_service_sign_in: %s\n" % e)

Parameters

Name Type Description Notes
username str The username to sign in with. [optional]
password str The password to sign in with. [optional]
never_expire bool Whether the session should never expire. [optional]

Return type

V1User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

auth_service_sign_in_with_sso

V1User auth_service_sign_in_with_sso(idp_id=idp_id, code=code, redirect_uri=redirect_uri)

SignInWithSSO signs in the user with the given SSO code.

Example

from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = memos.AuthServiceApi()
idp_id = 56 # int | The ID of the SSO provider. (optional)
code = 'code_example' # str | The code to sign in with. (optional)
redirect_uri = 'redirect_uri_example' # str | The redirect URI. (optional)

try:
    # SignInWithSSO signs in the user with the given SSO code.
    api_response = api_instance.auth_service_sign_in_with_sso(idp_id=idp_id, code=code, redirect_uri=redirect_uri)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthServiceApi->auth_service_sign_in_with_sso: %s\n" % e)

Parameters

Name Type Description Notes
idp_id int The ID of the SSO provider. [optional]
code str The code to sign in with. [optional]
redirect_uri str The redirect URI. [optional]

Return type

V1User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

auth_service_sign_out

object auth_service_sign_out()

SignOut signs out the user.

Example

from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = memos.AuthServiceApi()

try:
    # SignOut signs out the user.
    api_response = api_instance.auth_service_sign_out()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthServiceApi->auth_service_sign_out: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

auth_service_sign_up

V1User auth_service_sign_up(username=username, password=password)

SignUp signs up the user with the given username and password.

Example

from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = memos.AuthServiceApi()
username = 'username_example' # str | The username to sign up with. (optional)
password = 'password_example' # str | The password to sign up with. (optional)

try:
    # SignUp signs up the user with the given username and password.
    api_response = api_instance.auth_service_sign_up(username=username, password=password)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AuthServiceApi->auth_service_sign_up: %s\n" % e)

Parameters

Name Type Description Notes
username str The username to sign up with. [optional]
password str The password to sign up with. [optional]

Return type

V1User

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]