Related Content
- 10 years ago
- 3 years ago
- 5 years ago
Hello People,
I am new to Ready API and API automation in general.
For our API testing (JSON), initially we have to authorize with a bearer token in SWAGGER UI. Two API resources are present /auth/login & /auth/base64 and both these return an access token and user details respectively in encrypted format. The final bearer token format is: </auth/login: accesstoken>.</auth/base64 : message>
The bearer token has session time of 15 minutes after which we need to generate a new one.
Could anyone please let me know resources or steps on how to set the bearer token details for every Test Case in Ready API?
","kudosSumWeight":0,"postTime":"2022-01-04T05:34:07.514-08:00","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"attachments":{"__typename":"AttachmentConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"tags":{"__typename":"TagConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"TagEdge","cursor":"MjQuMTF8Mi4xfG98MTB8X05WX3wx","node":{"__typename":"Tag","id":"tag:Configuration","text":"Configuration","time":"2018-07-27T04:50:35.533-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}},{"__typename":"TagEdge","cursor":"MjQuMTF8Mi4xfG98MTB8X05WX3wy","node":{"__typename":"Tag","id":"tag:Function Tests","text":"Function Tests","time":"2021-08-24T02:50:27.810-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}},{"__typename":"TagEdge","cursor":"MjQuMTF8Mi4xfG98MTB8X05WX3wz","node":{"__typename":"Tag","id":"tag:REST","text":"REST","time":"2015-06-12T07:50:46.071-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}},{"__typename":"TagEdge","cursor":"MjQuMTF8Mi4xfG98MTB8X05WX3w0","node":{"__typename":"Tag","id":"tag:Test Setup","text":"Test Setup","time":"2021-08-24T13:18:52.927-07:00","lastActivityTime":null,"messagesCount":null,"followersCount":null}}]},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:228020_1"},"latestVersion":null,"metrics":{"__typename":"MessageMetrics","views":5065},"visibilityScope":"PUBLIC","canonicalUrl":null,"seoTitle":null,"seoDescription":null,"isEscalated":null,"placeholder":false,"originalMessageForPlaceholder":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}},"archivalData":null,"customFields":[],"body":"Hello People,
I am new to Ready API and API automation in general.
For our API testing (JSON), initially we have to authorize with a bearer token in SWAGGER UI. Two API resources are present /auth/login & /auth/base64 and both these return an access token and user details respectively in encrypted format. The final bearer token format is: </auth/login: accesstoken>.</auth/base64 : message>
The bearer token has session time of 15 minutes after which we need to generate a new one.
Could anyone please let me know resources or steps on how to set the bearer token details for every Test Case in Ready API?
"},"Conversation:conversation:228020":{"__typename":"Conversation","id":"conversation:228020","solved":true,"topic":{"__ref":"ForumTopicMessage:message:228020"},"lastPostingActivityTime":"2022-01-13T06:42:02.258-08:00","lastPostTime":"2022-01-13T06:42:02.258-08:00","unreadReplyCount":2,"isSubscribed":false},"ModerationData:moderation_data:228020":{"__typename":"ModerationData","id":"moderation_data:228020","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"Revision:revision:228020_1":{"__typename":"Revision","id":"revision:228020_1","lastEditTime":"2022-01-04T05:34:07.514-08:00"},"AcceptedSolutionMessage:message:228024":{"__typename":"AcceptedSolutionMessage","id":"message:228024","conversation":{"__ref":"Conversation:conversation:228020"},"author":{"__ref":"User:user:97485"},"revisionNum":1,"uid":228024,"depth":1,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:readyapi-questions"},"parent":{"__ref":"ForumTopicMessage:message:228020"},"subject":"Re: Bearer Auth Token - How to pass as header for each API resource","moderationData":{"__ref":"ModerationData:moderation_data:228024"},"body":"Hi,
We have a few different options here.
You could use OAuth 1 or OAuth 2 profiles to retrieve those tokens in an automated fashion. You could also automatically refresh the token after a certain duration.
OAuth 1: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth1/index.html
OAuth 2: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/index.htm
OAuth 2 Advanced options: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/advanced-options.html
Or you could add a header parameter, and pass the token to an authentication header via get data. I think we should try the authentication profiles to start as we get more automation friendly advanced options.
General auth page: https://support.smartbear.com/readyapi/docs/requests/auth/index.html
Hi,
We have a few different options here.
You could use OAuth 1 or OAuth 2 profiles to retrieve those tokens in an automated fashion. You could also automatically refresh the token after a certain duration.
OAuth 1: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth1/index.html
OAuth 2: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/index.htm
OAuth 2 Advanced options: https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/advanced-options.html
Or you could add a header parameter, and pass the token to an authentication header via get data. I think we should try the authentication profiles to start as we get more automation friendly advanced options.
General auth page: https://support.smartbear.com/readyapi/docs/requests/auth/index.html
Thank you for the reply Matt!
\n\n
Hi Amytav, does this help?
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"84","kudosSumWeight":0,"repliesCount":0,"postTime":"2022-01-13T06:42:02.258-08:00","lastPublishTime":"2022-01-13T06:42:02.258-08:00","metrics":{"__typename":"MessageMetrics","views":4755},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:ready_api_forums/community:nwkab66374board:readyapi-questions/message:228020/message:228463","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}}},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1720711077000":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1720711077000","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"readyapi-questions","messageSubject":"bearer-auth-token---how-to-pass-as-header-for-each-api-resource","messageId":"228020","replyId":"228024"},"buildId":"OKtI0OLKuXmERTJKBVqYX","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"smartbear","openTelemetryServiceVersion":"24.11.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/List/ListGroup/ListGroup.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","../shared/client/components/common/List/UnwrappedList/UnwrappedList.tsx","./components/tags/TagView/TagView.tsx","./components/tags/TagView/TagViewChip/TagViewChip.tsx"],"appGip":true,"scriptLoader":[]}🎉 NEW API Hub and Insight Hub are here to simplify workflows and help you deliver quality faster. Learn More