NEW @W-22178016@ Implement Org JWT Minting#462
Conversation
|
Git2Gus App is installed but the |
| async mintOrgJwt(featureId: string = 'VibesService'): Promise<string> { | ||
| const accessToken = this.getAccessToken(); | ||
| const instanceUrl = this.getInstanceUrl(); | ||
|
|
||
| const endpoint = `${instanceUrl}/ide/auth`; |
There was a problem hiding this comment.
We can use variables for passing feature id and using endpoint rather than directly hard-coding.
| this.emitLogEvent(LogLevel.Fine, 'Minting Org JWT for SFAP API access'); | ||
|
|
||
| try { | ||
| const response = await fetch(endpoint, { |
There was a problem hiding this comment.
This is boiler plate code we can consider moving to a helper file.
| const accessToken = this.getAccessToken(); | ||
| const instanceUrl = this.getInstanceUrl(); | ||
|
|
||
| const endpoint = `${instanceUrl}/ide/auth`; |
There was a problem hiding this comment.
This endpoint was also created by you? Im wondering which ECA are you using to mint the JWT from. Probably if this endpoint was also created by you, that is present there.
There was a problem hiding this comment.
Otherwise this code is to call a core endpoint, that should be fine. (my only concern is if security approves exposing an endpoint to mint a JWT (although this is not part of this story), im assuming that as you already have the opaque access token it might be ok)
There was a problem hiding this comment.
the endpoint already exists and we are just adding a feature id for our use case. and as you mentioned the jwt is generated by already existing access token only
No description provided.