Skip to content

Where should auth credentials be stored (e.g oauth2 access token)? #675

Closed Answered by cdavernas
giorgosera asked this question in Q&A
Discussion options

You must be logged in to vote

Based on my current understanding there are two options for storing the auth credentials with Serverless DSL:

  • Authdef: but authdef doesn't seem to have a place for an access token to be stored (unless this is what subjectToken is)

If you want to store a token directly, you can:

  1. Use the bearer authentication scheme:
...
auth:
- name: MyBearerAuth
  scheme: bearer
  properties:
     token: 'MyJwtToken'
...
  1. Use secrets, directly in runtime expressions ($SECRETS.MYSECRET.TOKEN), or by setting the properties of an AuthDef to the name of the secret that contains the expected data (i.e. { "token": "MyToken" })
  2. Do it properly: use OAUTH2, with the client_credentials flow, or, in your case,…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@giorgosera
Comment options

@ricardozanini
Comment options

@giorgosera
Comment options

@ricardozanini
Comment options

@giorgosera
Comment options

Comment options

You must be logged in to vote
1 reply
@giorgosera
Comment options

Answer selected by giorgosera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants