Forum Discussion
QnA Embedding
- 8 years ago
I finally got it working by specifying tokenType as models.TokenType.Aad instead of models.TokenType.Embed.
var config = {
type: 'qna',
tokenType: models.TokenType.Aad,
accessToken: txtAccessToken,
embedUrl: txtEmbedUrl,
datasetIds: [txtDatasetId],
viewMode: models.QnaMode.Interactive,
question: txtQuestion
};
I finally got it working by specifying tokenType as models.TokenType.Aad instead of models.TokenType.Embed.
var config = {
type: 'qna',
tokenType: models.TokenType.Aad,
accessToken: txtAccessToken,
embedUrl: txtEmbedUrl,
datasetIds: [txtDatasetId],
viewMode: models.QnaMode.Interactive,
question: txtQuestion
};
kiran_subhedar wrote:
I finally got it working by specifying tokenType as models.TokenType.Aad instead of models.TokenType.Embed.
var config = {
type: 'qna',
tokenType: models.TokenType.Aad,
accessToken: txtAccessToken,
embedUrl: txtEmbedUrl,
datasetIds: [txtDatasetId],
viewMode: models.QnaMode.Interactive,
question: txtQuestion
};
I'd suggest using "tokenType: models.TokenType.Embed", the main concern is that the models.TokenType.Aad would have more security risk. The access token would be plaintext in your web page, with the access token anyone can access all reports, dashboards, datasets etc via REST API, while using embedded token which is specific for the embedded objects has narrowed-down access permissions. Meanwhile For feature Row Level Security in Embedding for your customers scenario, you'll have to use embed token.
- kiran_subhedar8 years agoRegular Visitor
Eric_Zhang, actually I did tried to use the guidelines mentioned on page GenerateToken (Generate token for Q&A), and tried to mimic the example on the page to get a token for Q&A but received a Forbidden error. I think that this code meant to be used for Embedding for Customers, where in our website we are embedding for an organization, for which the method of generating a token is different, hence I used the token type as AaD. Moreover, do I need to generate a separate token for Q&A, in addition to the AaD token?
Thanks,
Kiran