Corticosteroids are known to diminish immune response ability, which is generally used in routine premedication for chemotherapy. The intersecting of timeframe between the corticosteroid's duration of action and peak COVID-19 vaccine efficacy could impair vaccine immunogenicity. Thus, inquiring about corticosteroids affecting the efficacy of vaccines to promote effective immunity in this population is needed. This was a prospective longitudinal observational cohort study that enrolled patients with solid cancer classified into dexamethasone- and nondexamethasone-receiving groups. All participants were immunized with two doses of ChAdOx1 nCoV-19 or CoronaVac vaccines. This study's purpose was to compare corticosteroid's effect on immunogenicity responses to the SARS-CoV-2 S protein in patients with cancer after two doses of COVID-19 vaccine in the dexamethasone and nondexamethasone group. Secondary outcomes included the postimmunization anti-spike (S) immunoglobin G (IgG) seroconversion rate, the association of corticosteroid dosage, time duration, and immunogenicity level. Among the 161 enrolled patients with solid cancer, 71 and 90 were in the dexamethasone and nondexamethasone groups, respectively. The median anti-S IgG titer after COVID-19 vaccination in the dexamethasone group was lower than that in the nondexamethasone group with a statistically significant difference (47.22 v 141.09 U/mL, P = .035). The anti-S IgG seroconversion rate was also significantly lower in the dexamethasone group than in the nondexamethasone group (93.83% v 80.95%, P = .023). The lowest median anti-SARS-CoV-2 IgG titer level at 7.89 AU/mL was observed in patients with the highest dose of steroid group (≥37 mg of dexamethasone cumulative dose throughout the course of chemotherapy [per course]) and patients who were injected with COVID-19 vaccines on the same day of receiving dexamethasone, 25.41 AU/mL. Patients with solid cancer vaccinated against COVID-19 disease while receiving dexamethasone had lower immunogenicity responses than those who got vaccines without dexamethasone. The direct association between the immunogenicity level and steroid dosage, as well as length of duration from vaccination to dexamethasone, was observed.