While injecting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY through Gitlab variables is a very common practice, it is a suboptimal approach, even when using the Protected flag. Instead the OIDC protocol should be leverage to build more secure pipeline. This will be a very hands-on tutorial on how to it
Get the OIDC token
This is already well documented in the official documentation, but in short: you can ask GitLab to generate one or more tokens for job execution. The name of the token can be anything you choose—ideally, something meaningful. The audience should represent the external system the token is intended for. In this case, STS refers to AWS Secure Token Service.
Exchanging the OICD token
The next step is to exchange the OIDC token for AWS temporary credentials. This is done using STS (Secure Token Service). The syntax is a bit awkward, but it’s still fairly simple. Once complete, you’ll be able to use the AWS CLI as expected.
Configuring AWS
The part were most people struggle is to configure the AWS side. In AWS create go to IAM > Identity providers and create a new one.
If you are unsure about the URL, add /.well-known/openid-configuration to it and it should return JSON. Every OIDC provider exposes their configuration at this endpoint. For Gitlab, the url is https://gitlab.com
Note that the audience field is actually arbitrary—just make sure it matches on both GitLab and AWS, and that it has a meaningful value.
Create an IAM role
This is the fun part—you can now create an IAM role that uses the identity provider we just created as its trusted entity.
Always respect the Principle of Least Privilege when adding permissions!
GitLab includes a sub value in the OIDC token that contains the group, project, and branch information. This is extremely powerful! It means you can create IAM roles that are only usable when running from a specific branch.
For example, the IAM role that deploys to production should include a condition that restricts its usage to the prod branch. In GitLab, you can then enforce protections on the prod branch, such as requiring code reviews. By combining the granularity of IAM roles with GitLab’s branch protection features, you can build a highly secure and compliant DevOps pipeline.
Other articles

How Top Convenience Stores Win with Mobile Loyalty Apps: The 4 Ps Framework
Discover the 4 Ps framework — Play, Pay, Personalize, Predict — driving mobile loyalty app success for today's top convenience store brands.

Gamification
Far beyond just playfulness, gamification is a powerful experiential strategy for positively influencing behavior.

Fenplast x Thirdbridge
When an Aging Extranet Becomes the Engine of a New Digital Era

Churn Rate: Why Mobile App Users Leave — and How to Keep Them
The churn rate, or attrition rate, refers to the percentage of users who stop using an app over a given period. In other words, it measures the user loss rate.

3 tips for using push notifications effectively in your app
Push notifications can become one of the most powerful touchpoints in your mobile strategy.

Low-Code / No-Code: Advantages, Limitations, and Best Practices
Low-code/no-code is an excellent gateway for testing a concept, validating a market, or quickly launching a first version of a mobile app.

Customer Data & Mobile Experience: What the Sears Catalog, Lululemon, Sephora and Canadian Tire Have in Common
Mobile-generated data is valuable — but too often trapped in silos.

Humanizing Mobile Apps to Enrich the User Experience
A mobile app should inspire trust and forge a genuine connection with its audience.

Cloud Infrastructure: Why Choose AWS?
This ongoing dominance makes AWS a natural default.

You Can’t Stop Entropy
Why Do We Use Terraform to Manage Our GitHub Account

Driving Loyalty Through Mobile: Focus on Relationship and Engagement
Customer loyalty is much more complex than just offering a loyalty program or good service.

GitLab OIDC
How to interact securely with AWS from GitLab.

GitHub OIDC
How to interact securely with AWS from GitHub.

Personalizing the Mobile Experience: The 5 Essential Pillars
Personalization must be at the heart of digital strategies to ensure the creation of experiences that are engaging, seamless, relevant, and tailored to user needs.

How to Succeed in Mobile App Development in 2025
Developing an application isn't something you can just wing. To succeed in this coveted domain, being well-prepared is essential. Unfortunately, a vast majority of large-scale digital projects fail due to inadequate preparation.

CMS for your mobile app?
A quick guide to choosing the right CMS for your mobile app—comparing top platforms and highlighting integration tips for scalability and flexibility.

Why a Maintenance Plan?
One of the most overlooked aspects of software development projects is the maintenance phase. A project is rarely ever truly finished; it will continue to require a non-negligible amount of work over time.

Strategic Workshops: A Tailored Approach to Your Project Needs
Strategic workshops are at the core of our collaborative process, enabling us to co-create relevant and innovative solutions for our clients and their customers.

Proximity Technologies
Presentation of various technologies enabling mobile applications to interact with the physical world.

Boost Customer Loyalty: The Power of a Mobile App
Boost customer loyalty and engagement with KPI-focused mobile app strategies, driving measurable results and maximizing ROI.

Aligning SSO with Business Models
It’s essential to align your business model with the cost structure of the SSO provider. Otherwise, the success of your product could quickly become a financial burden!

User Interviews: A Key but Often Overlooked Step
A great idea doesn’t always guarantee success. Before making any decisions, it's essential to consider the actual needs and expectations of end users.

25 Key Trends to Optimize Your Mobile App in 2025
The Thirdbridge team has compiled this article outlining 25 trends to consider for mobile app development or strategy, or any other type of digital product in 2025.

AI driving innovation: A new Era for Mobile Apps and User Experience
Artificial intelligence (AI) represents a digital transformation that impacts us all. This rapidly advancing technology, fueled by data analysis, not only enables informed decision-making and reliable forecasting but also allows for the completion of many tasks at a faster pace.

How to Gauge your Mobile App's performance?
A mobile application is the extension of a brand's customer experience.

Enhancing Product Management: Key to Success in Software Development
The distinction between product management and project management is essential for ensuring optimal productivity. It’s not enough to treat them as interchangeable concepts; it’s crucial to adopt a proactive approach to place the right resources in the right places.

Cybersecurity and Mobile Applications: Choosing the Right Authentication Method
Mobile applications are essential tools that handle personal data, access sensitive information, and are part of our daily lives. However, in an age where the term cybersecurity is on everyone's lips, ensuring the security of these applications and the information they contain is crucial.

The impact of UX research
Integrating user experience (UX) principles and practices into the software or application development process has become crucial.

PWAs: Test the Potential of Mobile Apps
With the advent of mobile applications, our daily lives have been transformed: these simple tools have become essential facilitators of daily tasks and catalysts for professional and personal interactions.

The Phygital: Rethinking the Retail
Businesses have always had to innovate and rethink their approaches to remain relevant, and this is even more true in the digital age.

Hybrid vs. Native: Making the Right Choice
At Thirdbridge, the preferred development approach is hybrid. But let's delve deeper by comparing hybrid and native development across key stages of application development: costs, performance, security, and maintenance.

Recruiting an In-House Team or Hiring an Agency for Developing Your Application?
When embarking on a project as significant and important as developing an application, a crucial dilemma quickly arises: choosing between a specialized agency or recruiting your own in-house team to accomplish the work. One thing is certain, both options present distinct advantages and constraints.

Do You Really Need an Application?
Don't furrow your brows! This is a genuinely good question. Just observe people on the subway, for example, or in a waiting room: almost everyone has a phone in hand, whether to read, text, play, get information, meet a soulmate, order food, or shop...

Maximizing Your App's Profitability: Our Advice
Whether you're looking to save time for your users, retain them, or enhance their shopping experience, we're sharing here the three key elements to consider to maximize your return on investment (ROI).

Succeeding in Your Updates in 5 Steps
Did you know that at least 20% of the development time of an application should be allocated to testing and quality assurance?

Beyond Launch: Ensuring the Longevity of Your Application
You've diligently followed the development stages of your application and are about to launch it: congratulations! But even though this is a great accomplishment, your job is far from over...

Couche-Tard Connecté: The Cashierless Convenience Store
Congratulations to our mobile development team, who gave their all in recent weeks to ensure a smooth launch of the Couche-Tard Connecté project.

Our 12 tips for succeeding in a software project after 12 years in the industry
Thirdbridge celebrates its 12th anniversary!