-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added api call for generating access token and did #98
Conversation
src/ssiApi/apiAuth/apiAuth.ts
Outdated
this.apiKey = apiKey | ||
} | ||
async generateAccessToken(): Promise<IgenerateToken> { | ||
const studioApiUrl = "https://api.entity.hypersign.id/api/v1/app/oauth" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
studioApiUrl
should not be hardcoded here, put it in config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya i have added it in separate file now. Yet not commited
src/ssiApi/apiAuth/apiAuth.ts
Outdated
const studioApiUrl = "https://api.entity.hypersign.id/api/v1/app/oauth" | ||
const headers = { | ||
"X-Api-Secret-Key": this.apiKey, | ||
"Origin": "https://entity.hypersign.id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Origin should not also be hardcoded, I guess you need to take this in constructor params
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need of passing origin. Its working fine without passing origin also
this.accessToken = accessToken.access_token | ||
} | ||
public async generateDid(params: IGenerateDid) { | ||
const apiUrl = "https://api.entity.hypersign.id/api/v1/did/create" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also should not be hardcoded here
const headers = { | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${this.accessToken}`, | ||
Origin: "https://entity.hypersign.id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take this in constructor params
… getting correct error response
Implemented api call from sdk to studio-api for creating, registering, resolving and updating a didDoc