From the film's promotion website:
It’s the early 1970s, a time of great social upheaval as the struggle for civil rights rages on. Ron Stallworth (John David Washington) becomes the first African-American detective on the Colorado Springs Police Department, but his arrival is greeted with skepticism and open hostility by the department’s rank and file. Undaunted, Stallworth resolves to make a name for himself and a difference in his community. He bravely sets out on a dangerous mission: infiltrate and expose the Ku Klux Klan.
Posing as a racist extremist, Stallworth contacts the group and soon finds himself invited into its inner circle. He even cultivates a relationship with the Klan’s Grand Wizard, David Duke (Topher Grace), who praises Ron’s commitment to the advancement of White America. With the undercover investigation growing ever more complex, Stallworth’s colleague, Flip Zimmerman (Adam Driver), poses as Ron in face-to-face meetings with members of hate group, gaining insider’s knowledge of a deadly plot.BlacKkKlansman - Original News Story