mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-05 14:13:15 +08:00
Inital draft of OIDC Client
This commit is contained in:
38
packages/oidc-client/README.md
Normal file
38
packages/oidc-client/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
<h2>@actions/oidc-client</h2>
|
||||
|
||||
<h3>Usage</h3>
|
||||
|
||||
You can use this package to interact with the github oidc provider.
|
||||
|
||||
<h3>Get the ID token</h3>
|
||||
|
||||
Method Name: getIDToken
|
||||
|
||||
<h3>Inputs</h3>
|
||||
|
||||
Client id
|
||||
The client id registered with oidc provider
|
||||
Required
|
||||
Client secret
|
||||
The client secret
|
||||
Required
|
||||
|
||||
These inputs are temporary. They will be modified once the complete package is available.
|
||||
|
||||
|
||||
<h3>Example:</h3>
|
||||
|
||||
```
|
||||
const core = require('@actions/core');
|
||||
const id = require('@actions/oidc-client')
|
||||
|
||||
|
||||
async function getID(){
|
||||
const id_token = await id.getIDToken('client-id', 'client-secret')
|
||||
const val = `ID token is ${id_token}`
|
||||
core.setOutput('id_token', id_token);
|
||||
|
||||
}
|
||||
|
||||
getID()
|
||||
```
|
||||
Reference in New Issue
Block a user