
fis.28013 (Customer) asked a question.
Hi Okta, I have follow the guideline from Okta for build pwa basic CRUD from https://developer.okta.com/blog/2018/02/15/build-crud-app-vuejs-node*complete-the-posts-manager-component .
The app running successfully including login on okta. But, when i want save post, there is no data update on that table. The error i get from the console are:
Error: expected audience is required
at verifyAudience, OktaJWTVerifier & processTicksAndRejections
How to solve this problem?
Thanks .

Hi fi sya,
The Okta JWT verifier has been updated since the blog article was written and it requires a secondary parameter for "verifyAccessToken" method which contains the audience that is expected in the token.
Can you please change all the references for verifyAccessToken and add a secondary parameter function, for example verifyAccessToken(accessToken, "api://default"), and try again?
The audience is available in the Settings of your authorization server under Admin >> API >> Authorization Servers >> Audience.
Dragos Gaftoneanu
Developer Support Engineer
Okta Global Customer Care
Add an extra argument to the verify access token method.
oktaJwtVerifier.verifyAccessToken(accessToken, 'api://default')
.then(jwt => {
req.user = {
uid: jwt.claims.uid,
email: jwt.claims.sub
}
next();
})
.catch(next); // jwt did not verify!.